- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Create a new callback function named say, Timercb()
CyU3PTimer Timer; // define this handle
void TimerCb()
{
// Here you get the callback after Time_in_millisecond
}
void TimerInit(void)
{
CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;
apiRetStatus = CyU3PTimerCreate(&Timer, TimerCb, 0, Time_in_millisecond, Time_in_millisecond, 1);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (2, "TimerCreate failed, Error Code = %d\r\n", apiRetStatus);
}
}
Note: For further understanding you can refer to CyU3PTimerCreate() API in API Guide
Regards
Abhinav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Create a new callback function named say, Timercb()
CyU3PTimer Timer; // define this handle
void TimerCb()
{
// Here you get the callback after Time_in_millisecond
}
void TimerInit(void)
{
CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;
apiRetStatus = CyU3PTimerCreate(&Timer, TimerCb, 0, Time_in_millisecond, Time_in_millisecond, 1);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (2, "TimerCreate failed, Error Code = %d\r\n", apiRetStatus);
}
}
Note: For further understanding you can refer to CyU3PTimerCreate() API in API Guide
Regards
Abhinav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi EliW,
I found that you have not called the function TimerInit () in your code. Please find the attached project where I have added the relevant code. Also, it is not recommended to add Debug prints inside callback functions. So, I have used a global variable to check if the callback was invoked or not. Using these modifications, I can find that the timer callback function was invoked at my end. Please find the snapshot of the tera term below:
Jayakrishna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks! it works!
EliW.