Download Print this page

Hitachi HF-BT1000 User Manual page 90

Advertisement

6.1.3 Watchdog timer control function (WdtControl)
<Name>
WdtControl - Watchdog timer control
<Syntax>
#include <hfbras.h>
BOOL WdtControl(DWORD dwCmd, PDWORD pdwCount);
<Description>
This function performs the action specified by dwCmd on the watchdog timer.
In order to use this function, in the RAS Setup window, select Retriggered by application
program under Watchdog timer setting. If the watchdog timer setting is different, this function
terminates with an error. If you call the GetLastError Windows API function, an error code
HFB_WDT_NONMANUAL is returned.
Also, when you control the watchdog timer by using this function, call the function with the
interval of five seconds or more. If you have called the function without this interval, this function
terminates with an error. If you call the GetLastError Windows API function, an error code
ERROR_BUSY(0xAA) is returned.
Each parameter of this function is explained below.
dwCmd:
This parameter specifies which action is performed on the watchdog timer. The following
options are available for this parameter.
Table 6-2 List of Actions of WdtControl Specified by dwCmd
WDT_SET (0x00)
WDT_STOP (0x01)
If a value other than the above is specified, this function terminates with an error. If you call the
GetLastError Windows API function, an error code HFB_INVALID_PARAMETER is
returned.
pdwCount:
If dwCmd is WDT_SET, you can configure the timeout of the watchdog timer by specifying the
timeout of the watchdog timer in the variable pointed by pdwCount and calling this function.
Specify a value between 10 and 63 in seconds. If a value other than the above is specified, this
function terminates with an error. If you call the GetLastError Windows API function, an error
code HFB_INVALID_PARAMETER is returned.
When this function returns, the value of the variable pointed by pdwCount is undefined. Do not
use the value.
If dwCmd is WDT_STOP, the value of pdwCount is ignored. When this function returns, the
value of the variable pointed by pdwCount is undefined. Do not use the value.
dwCmd
Specifies the timeout (in seconds).
Stops the watchdog timer.
Explanation of the action
6-3
6. LIBRARY FUNCTIONS

Advertisement

loading