sysFailsafe [lopec] - Interface routines for Failsafe Timer support
sysFailsafeSet( ) - Set the failsafe timer.
sysFailsafeGet( ) - Get the failsafe timer configuration parameters.
sysFailsafeCancel( ) - This routine disables the failsafe timer.
sysFailsafeIntr( ) - Interrupt handler for the Failsafe timer.
sysFailsafeCausedReset( ) - Determine if failsafe timer caused last board reset.
sysFailsafeShow( ) - Display current failsafe timer configuration parameters.
This code provides the failsafe timer interface.
The routines defined in this file are intended as user-callable routines. The routines themselves call device-specific routines as defined by the following in the board header file:
- FAILSAFE_SET(x,y)
- Sets the failsafe timer.
- FAILSAFE_GET(x,y)
- Gets the current failsafe timer configuration parameters.
- FAILSAFE_CANCEL( )
- Cancels the failsafe timer.
- FAILSAFE_SHOW( )
- Shows the current failsafe timer configuration parameters.
- FAILSAFE_CAUSED_RESET( )
- Determines whether the failsafe timer caused the last board reset.
sysFailsafeSet( ) - Set the failsafe timer.
STATUS sysFailsafeSet ( UCHAR seconds, /* Time until timer expiration */ BOOL reset /* reset=FALSE, interrupt, reset=TRUE, */ /* board reset */ )
This routine sets the failsafe timer. The timer can be configured to either generate an interrupt or reset the board upon expiration. The routine expects the timer interval "seconds" and an expiration parameter "reset". Seconds can be set anywhere from 0 to 31. If set to 0 the timer is disabled. Reset is a boolean. If set to FALSE, an interrupt will be generated. If set to TRUE, the board will be reset.
OK, or error if one of the parameters is invalid.
sysFailsafeGet( ) - Get the failsafe timer configuration parameters.
STATUS sysFailsafeGet ( UCHAR * seconds, /* Time until timer expiration */ BOOL * reset /* reset=FALSE, interrupt, reset=TRUE, */ /* board reset */ )
This routine gets the current failsafe timer configuration parameters NOT the amount of time remaining until timer expiration.
OK always.
sysFailsafeCancel( ) - This routine disables the failsafe timer.
void sysFailsafeCancel (void)
A call to this routine will disable the failsafe timer.
void.
sysFailsafeIntr( ) - Interrupt handler for the Failsafe timer.
void sysFailsafeIntr (void)
When the failsafe timer expires, either an interrupt is generated or a board reset. This is an example interrupt handler routine. This routine prints a "*" every time the failsafe timer interrupt is fired.
To define your own failsafe timer interrupt handler, simply edit this routine.
void.
sysFailsafeCausedReset( ) - Determine if failsafe timer caused last board reset.
BOOL sysFailsafeCausedReset (void)
This routine determines whether the failsafe timer caused the last board reset. To determine whether or not the failsafe timer caused the last board reset you must call this routine before setting an alarm. When an alarm is set, all flags including the failsafe timer flag are cleared.
True, if the failsafe timer caused the last board reset, false otherwise.
sysFailsafeShow( ) - Display current failsafe timer configuration parameters.
STATUS sysFailsafeShow (void)
This routine displays the current failsafe timer configuration parameters.
OK always.