Watchdogs
|
wdCreate ( ) |
Name: |
wdCreate ( ) - creates a watchdog |
Synopsis: |
WD_HANDLE wdCreate
(
WD_FUNCTION wdFunction, /* watchdog function pointer */
u32 u32Data /* parameter to pass to watchdog function */
)
|
Description: |
Creates a watchdog timer. The wdFunction is called when the
timer expires. The wdFunction takes the one parameter u32Data.
Newly created timers are created in the expired state so a call to
wdRestart must be made to start the timer.
The watchdog callback wdFunction takes the form
void wdFunction (u32 u32Data)
Note that timers normally execute within the kernel, so watchdog
handler functions should either be very small or use a synchronization
mechanism like semaphores or messages
to allow a task to handle the event. Also note that within the watchdog
handler the full set of kernel routines are not normally available.
|
Include: |
watchdog.h |
Returns: |
The WD_HANDLE of the newly created watchdog. Note that this
function will not return if the watchdog cannot be created, instead
the system will halt (during development) or reboot (if in the field)
so there are no illegal values that can be returned. |
See Also: |
wdDestroy, wdRestart
|
|
wdDestroy ( ) |
Name: |
wdDestroy ( ) - destroys a watchdog |
Synopsis: |
void wdDestroy
(
WD_HANDLE wdHandle /* watchdog to destroy */
)
|
Description: |
Deletes a watchdog from the system. |
Include: |
watchdog.h |
Returns: |
nothing |
See Also: |
wdCreate, wdRestart
|
|
wdRestart ( ) |
Name: |
wdRestart ( ) - starts or restarts a timer |
Synopsis: |
void wdRestart
(
WD_HANDLE wdHandle, /* watchdog to start/restart */
u32 u32MillisecondsToWait /* number of ms before expiration */
)
|
Description: |
Starts or restarts a timer. You can use WD_DISABLE for the
u32MillisecondsToWait parameter if you want to place the timer
in an expired state without waiting for the timer to expire on its
own. |
Include: |
watchdog.h |
Returns: |
nothing |
See Also: |
wdCreate, wdDestroy
|
|