Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 5781

ThreadX periodic task awakening (analogue of FreeRTOS vTaskDelayUntil() )

$
0
0

Hello!


Is there a way in ThreadX to make thread awake from sleep in loop with constant frequency? tx_thread_sleep() suspends thread for count of ticks relative to tick on which it was called. What I need is, for example, wake up my thread every 100ms regardless of execution time before sleep is called.


In FreeRTOS there is a function vTaskDelayUntil() for exactly this. You just need to store tick count (let's say it's variable TICKS) before first vTaskDelayUntil(PERIOD) call and everytime you call it it would suspend thread until TICKS+PERIOD tick and add PERIOD to TICKS variable for subsequent call.


Is there a simple way to do the same in ThreadX? I'd prefer to avoid creating timers and toggling semaphores for such task.


Thanks in advance, Eighth


Viewing all articles
Browse latest Browse all 5781

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>