I need to port a module from FREERTOS to MQX and it uses a couple of timers. In this module's logic, sometimes the timer shall be reset and start counting from the beginning before it expires. For that purpose, the module is using the xTimerReset Freertos API. Looking through the MQX documentation I can't find any functions that include "reset" in its name.
I see that there is a "_timer_cancel" function but the documentation is not clear about what this function does and I haven't found any examples about how to implement the restart behavior.
Does anyone know how to achieve this? Am I supposed to call _timer_cancel followed by one of the _timer_start_ APIs?
Solved! Go to Solution.
Hi Manuel:
There are two types of timers in MQX.
One-shot timers, which expire once.
Periodic timers, which expire repeatedly at a specified interval. When a periodic timer expires, MQX RTOS resets the timer.
From your description, it seems periodic timer is what you are looking for.
Please refer to the timer demo under the installation folder
Freescale_MQX_4_2\mqx\examples\timer
Regards
Daniel
Hi Manuel:
There are two types of timers in MQX.
One-shot timers, which expire once.
Periodic timers, which expire repeatedly at a specified interval. When a periodic timer expires, MQX RTOS resets the timer.
From your description, it seems periodic timer is what you are looking for.
Please refer to the timer demo under the installation folder
Freescale_MQX_4_2\mqx\examples\timer
Regards
Daniel