beautypg.com

6 s826_watchdogkick, 7 s826_watchdogeventwait, S826_watchdogkick – Sensoray 826 User Manual

Page 69: S826_watchdogeventwait

background image

Flag

Function

TO2

Timer2 timeout

TO1

Timer1 timeout

TO0

Timer0 timeout

Return Values

If the function succeeds, the return value is zero.

If the function fails, the return value is an error code.

9.3.6 S826_WatchdogKick

The S826_WatchdogKick function reads the watchdog timeout status.

int S826_WatchdogKick(
uint board, // board identifier
uint data // valid signature
);

Parameters

board

826 board number. This must match the settings of the board's dip switches as described in section 2.2.

data

Valid signature. This must be 0x5A55AA5A to kick the watchdog; any other value will fail to kick the watchdog,
although no error will be returned.

Return Values

If the function succeeds, the return value is zero.

If the function fails, the return value is an error code.

Remarks

When the watchdog system is running, the program should call this function to prevent a watchdog timeout. The
DELAY0 value determines how often this function must be called to prevent a timeout.

9.3.7 S826_WatchdogEventWait

The S826_WatchdogEventWait function waits for a watchdog event (timeout) on Timer1.

int S826_WatchdogEventWait(
uint board, // board identifier
uint tmax // maximum time to wait
);

Parameters

board

826 board number. This must match the settings of the board's dip switches as described in section 2.2.

tmax

Maximum time, in microseconds, to wait for data. See “Event-Driven Applications” for details.

Return Values

If the function succeeds, the return value is zero.

If the function fails, the return value is an error code.

826 Instruction Manual

64

Watchdog Timer