Is there an equivalent of FreeRTOS "xTimerReset" for MQX?

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

Is there an equivalent of FreeRTOS "xTimerReset" for MQX?

Jump to solution
1,059 Views
m4l490n
Contributor V

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?

Tags (3)
0 Kudos
Reply
1 Solution
957 Views
danielchen
NXP TechSupport
NXP TechSupport

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

View solution in original post

0 Kudos
Reply
1 Reply
958 Views
danielchen
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply