nOS icon indicating copy to clipboard operation
nOS copied to clipboard

timing API's

Open KimNZ opened this issue 6 years ago • 1 comments

What timing API's are available ? Can you give a quick description and when to use any of the following ones: NOS_NO_WAIT NOS_TICK_COUNT_MAX NOS_WAIT_INFINITE NOS_TICK_COUNT_MAX

Have I got all the timing API's ?

Is there a list of all the API's somewhere ? Thanks

KimNZ avatar Oct 02 '17 07:10 KimNZ

Hi KimNZ,

I have seen your request and will try to give you a complete answer as soon as I can, but for the moment, you can check in the code for nOS_Sleep and nOS_SleepUntil that can delay you thread for a number of ticks or until the tick counter reach the value you specified. You have nOS_Timer object to execute a callback after a specific number of ticks or periodically.

The define NOS_NO_WAIT (0) is used when you dont want to wait for the event. NOS_WAIT_INFINITE is equivalent to NOS_TICK_COUNT_MAX (highest value following from your config: 255 for 8 bits, 65535 for 16 bits, ...) and is used to never timeout when waiting for an event. Everything in between is the number of ticks you can wait before giving up.

Let me know if you need more info

Thanks, Jim

jimtremblay avatar Oct 06 '17 17:10 jimtremblay