========================================================================
8260wdt readme.txt for the Windows AXIOM SBC8260VE CPU board
watchdog timer driver.
MBARI
Monterey Bay Aquarium Research Institute
========================================================================
History:
Created: 5:20 PM 1/5/01 D.Cline
========================================================================

This files contains notes on how to use the 8260wdt.dll in your application.
Note the 8260wdt.dll can be used on a WindowsNT\98 system only.


1. 8260wdt.dll should be located in the \winnt\system32 directory

2. To use the 8260wdt.dll in your program, link library 8260wdt.lib 
and include the file 8260wdt.h with your application.

3. Interface
-------------------------------------------------------
function programtimer(unsigned int seconds)
-------------------------------------------------------
program timer will program and enable the timer to go off in 
<seconds> time. The watchdog timer will either generate a
system reset or non-maskable interrupt(NMI), depending on 
jumper JP3 settings on the SBC8260VE after seconds have elapsed
and the timer has not been reset.

-------------------------------------------------------
function resettimer()
-------------------------------------------------------
Resets the timer. 

Valid arguments for seconds are 300, 100, 60, 30, 10, or 5.
resettimer will default to 300 if <seconds> is a bad argument.

-------------------------------------------------------
function disabletimer()
-------------------------------------------------------
Disables the watchdog timer. To reenable the watchdog
timer call programtimer, followed by resettimer.

3. Example C code on how to use this in a WinNT application

// Application  file  test.c to test 8260wdt.dll 
void main(int argc, const char* argv[])
{	
	
	time_t begin, end;
	double diffval;
	unsigned int secs;

	secs = 5;
	diffval = 0;
	begin = 0; end = 0;

	if(argc == 2)
		secs = (unsigned int)atoi(argv[1]);

	programtimer(secs);

	time(&begin);

	printf("Hit any key to quit\n");

  	do {

	time(&end);

	diffval = difftime(end,begin);	

	if (diffval >= secs){   //if more than <secs> elapsed, reset timer
		resettimer();
		time(&begin);
		printf("Hit any key to quit\n");
	}

	Sleep(500);			 //sleep 500 milliseconds

    } while (!_kbhit()); //any hit breaks loop

}
