How to change a Reload timer to One-shot timer in FreeRTOS
Hi All,
In my application, I need a FreeRTOS software timer. But this timer sometimes need the one-shot timer function, sometimes need the Reload timer function.
I use the xTimerCreate to create timer with the one-shot timer configuration. Next time, I need to config this timer as the Reload timer with a new timePeriod. But from the FreeRTOS API function, I could change the reload/one-shot directly. Also has no API to get to know the timer is a Reload/one-shot timer, need a seperate parameter to maintain.
The only way to achieve my function is to delete the origianl timer and create a timer again.
Could you help if there is a good method to achieve my functions, it will be better if can use existing API directluy.
Best Regards.
Thanks.
How to change a Reload timer to One-shot timer in FreeRTOS
Unless ram is very tight, or it causes some other difficulty, I would create two timers, one for the single shot mode, and one for repetative mode, and start/stop the one you want. I agree that I don’t see an API to change the mode (which might be a useful addition to the API)
How to change a Reload timer to One-shot timer in FreeRTOS
@Richard Damon,
Thanks, will FreeRTOS have plan to add an API/function to support this?
How to change a Reload timer to One-shot timer in FreeRTOS
For that you would have to ask someone at FreeRTOS, like the other Richard (Richard Barry)
How to change a Reload timer to One-shot timer in FreeRTOS
I think it would be an easy feature to add.