Functions | |
HANDLE | NutTimerStart (u_long ms, void(*callback)(HANDLE, void *), void *arg, u_char flags) |
Create an asynchronous timer. | |
void | NutSleep (u_long ms) |
Temporarily suspends the current thread. | |
void | NutTimerStopAsync (HANDLE handle) |
Asynchronously stop a specified timer. | |
void | NutTimerStop (HANDLE handle) |
Stop a specified timer. | |
void | NutDelay (u_char ms) |
Loop for a specified number of milliseconds. | |
u_long | NutGetCpuClock (void) |
Return the CPU clock in Hertz. | |
void | NutTimerInit (void) |
Initialize system timer. | |
Variables | |
NUTTIMERINFO *volatile | nutTimerList = 0 |
Linked list of all system timers. | |
NUTTIMERINFO *volatile | nutTimerPool = 0 |
|
Loop for a specified number of milliseconds. This call will not release the CPU and will not switch to another thread. However, because of absent thread switching, this delay time is very exact. Use NutSleep() to avoid blocking the CPU, if no exact timing is needed.
|
|
Return the CPU clock in Hertz.
|
|
Temporarily suspends the current thread. Causes the current thread to wait for a specified interval or, if the specified interval is zero, to give up the CPU for another thread with higher or same priority. This function may switch to another application thread, that got the same or a higher priority and is ready to run.
|
|
Initialize system timer. This function is automatically called by Nut/OS during system initialization. Nut/OS uses on-chip timer 0 for its timer services. Applications should not modify any registers of this timer, but make use of the Nut/OS timer API. Timer 1 and timer 2 are available to applications. |
|
Create an asynchronous timer. The function returns immediately, while the timer runs asynchronously in the background. The timer counts for a specified number of milliseconds, then calls the callback routine with a given argument. The callback function is executed from a system thread at a very high priority and must return as soon as possible and must not call any potentially blocking function.
|
|
Stop a specified timer. Only periodic timers need to be stopped. One-shot timers are automatically stopped by the timer management after ther first timer interval. Anyway, long running one-shot timers may be stopped to release the occupied memory.
|
|
Asynchronously stop a specified timer. Stops one-shot and periodic timers.
|
|
This pool is used to collect released memory from elapsed timers. It's required because we can't free memory in interrupt context. |