Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > one shot timer

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



one shot timer
Moderator:
RSKV

Post Reply
Follow this topic



one shot timer

gd_net posted on 04 Oct 2011 8:06 AM PST
Senior Member
17 Forum Posts

Hello,

is the one shot timer function (CyU3PTimerCreate with RescheduleTicks=0) already implemented?

I can not get it working.

Best regards

g.




Re: one shot timer

aasi posted on 05 Oct 2011 10:06 PM PST
Cypress Employee
1073 Forum Posts

Are you seeing any error being returned or does the API succeed but without the expected output?

Please post the code that you're using as well I would like to look at the parameters you're using.

Regards,

Anand



Re: one shot timer

gd_net posted on 05 Oct 2011 12:51 AM PST
Senior Member
17 Forum Posts

Hello,

i tried it like follows:

CyU3PTimer pTimer1;   // global

Initialisation:

    CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
    uint32_t nExpirationInput=0;
    uint32_t nInitialTicks = 10;
    uint32_t nRescheduleTicks = 0;       // If set to zero, the timer will be a one-shot timer
    uint32_t nTimerOption = CYU3P_NO_ACTIVATE;
    status = CyU3PTimerCreate(&pTimer1,TimerFunc1,nExpirationInput,nInitialTicks,nRescheduleTicks,nTimerOption);
    if (status != CY_U3P_SUCCESS){
            CyU3PDebugPrint (4, "CyU3PTimerCreate Failed, Error Code = %x\r\n",status);
        }
 

Start of one shot timer:

    CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

    status = CyU3PTimerStart(&pTimer1);    //re-start one-shot timer
    if (status != CY_U3P_SUCCESS)
        CyU3PDebugPrint (4, "CyU3PTimerStart Failed, Error Code = %x\r\n",status);
 

    CyU3PTimerStart gives me the error : CY_U3P_ERROR_ACTIVATE_FAILED

 

Best regards

g.

 






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.