Using xTimerReset() inside a timer callback

jacwit wrote on Tuesday, March 20, 2012:

Hi Everyone-

Is it acceptable to use xTimerReset() inside the timer’s callback function?

Before I start the scheduler, I create a timer with xAutoReload set to pdFALSE.
then I set it active using xTimerStart(). I check all the return codes to make sure

Inside the timer’s callback function, I use xTimerReset() to reload the timer.

It works but then the OS just hangs up. If I comment out the xTimerReset() code, it works fine with no issues.

Is this a bug or is this not allowed? Could i reset another timer using xTimerReset() inside a timer callback?



rtel wrote on Wednesday, March 21, 2012:

It is not a problem to call the reset function from inside the callback.


jacwit wrote on Wednesday, March 21, 2012:

Ok, I figured this out.

I thought configTIMER_TASK_STACK_DEPTH 80 would be sufficient.

It’s not, so I bumped it to 160 and it’s fine.

Suprising, since I coded a very contrived example.