AR-B1893CM6C User’s Guide
AR-B1893CM6C Celeron M Inside
with DDR SO DIMM, 4 Port built in LAN, 1 Mini PCI, 1 CF
36
5.1 Watch Dog Test program source codes :
/* Watchdog test program for AR-M9942 */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <conio.h>
#include <dos.h>
typedef unsigned char byte;
const byte config_port=0x2E;
const byte config_data=0x2F;
/* Global values */
static int time_unit=0; // 0=second
// 1=minute
static int time_out=3;
/* function reference */
void get_wdog_time(char *timestr);
void prepare_superio();
void close_superio();
void print_help_message();
void main(int argc, char *argv[])
{
unsigned long waiting_sec;
int x, y;
if(argc > 1) {
if(strcmp(argv[1],"-h") == 0) {
print_help_message();
exit(0);
}
get_wdog_time(argv[1]);
}
prepare_superio(); //turn-on watchdog
if(time_unit == 0)
waiting_sec = time_out;
else
waiting_sec = time_out * 60;
x=wherex();
y=wherey();
while(waiting_sec > 0) {