_timer_cancel()

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

_timer_cancel()

494 Views
alessandrobiasc
Contributor I

Hi all,

            I'm using MQX 4.2.2 and I have a problem with _timer_cancel() function call.

I'm calling _timer_cancel(id) within the timer's callback itself and it seems that MQX do not find myself and delete me from the scheduled timers in the system. The same function call, called outside the timer's callback works fine.

Question:

    - can _timer_cancel() be called inside the timer's callback itself or we need to call the function outside the timer ?

Best Regards,

           Alessandro.

0 Kudos
1 Reply

344 Views
DavidS
NXP Employee
NXP Employee

Hi Alessandro,

With my testing of the _timer_cancel() it too does not work from within the callback but does work when outside the callback.

Please cancel timer outside of the callback.

Regards,

David

PS

I ran test using C:\Freescale\Freescale_MQX_4_2\mqx\examples\timer for frdm-k64f using CW10.6.

main.c attached.