Custom Embedded Solutions
WIN Enterprises, Inc MB-80510 User Manual
51
3.2 Watchdog timer Sample Program for DOS environment
//WIN Watch dog program for EM-6333(Dos Version)
#include <stdio.h>
#include <string.h>
#include <dos.h>
#include <stdlib.h>
#include <inlines/pc.h>
#define index_port 0x2E
//Super IO Index port address
#define data_port 0x2F
//Super IO Data port address
void Enter_sio_config();
void Exit_sio_config();
void help();
int main(int argc, char *argv[])
{
int data_rw8, time;
if (argc<2){
help();
return;
}
if(strcmp(argv[1], "-s") == 0){
//Show Watchdog Register Settings
Enter_sio_config();
outportb(index_port, 0xF5);
data_rw8 = inportb(data_port)&0x08;
if(data_rw8 == 0x00){
//second mode
outportb(index_port, 0xF6);
data_rw8 = inportb(data_port);
printf("Second mode: %d second\n", data_rw8);
}