How to print debug message in timer call back function.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Peya_4162826
Level 2
Level 2
First like received

when debug message output is OK, then use CyU3PTimerCreate to create one timer, use CyU3PDebugPrint in timer call back function, It can not print message in call back function, I have confirm the timer call back have execute, in call back function increase one value, I have see this value increase when time elapse.

0 Likes
1 Solution
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello,

Please do not use debug messages in the call back function. Instead, set an event flag in the callback function and check for the event in the thread loop to print the debug message.

Best regards,

Srinath S

View solution in original post

0 Likes
3 Replies
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello,

Please do not use debug messages in the call back function. Instead, set an event flag in the callback function and check for the event in the thread loop to print the debug message.

Best regards,

Srinath S

0 Likes

Hi,

I know, it is only for debug, Not for release version.

0 Likes

Hello,

The CyU3PDebugPrint() API can encounter a failure when invoked from a callback function. You can check the return value of the API by setting it to a global variable and reading it in the thread main loop.

Best regards,

Srinath S

0 Likes