Specifications

EPC-21/22 Hardware Reference
Page A6
BB
// The 82360SL configuration space is enabled by performing
// four sequential reads to the addresses listed below.
*/
(void) inp(0xFC23);
(void) inp(0xF023);
(void) inp(0xC023);
(void) inp(0x0023);
return flags;
}
void
disablespace(unsigned short flags)
{
outp(CFGINDEX,0xFA);
outp(CFGDATA,0x01);
restoreflags(flags);
}
void
refreshtimer()
{
setconfigurationregister(T2COMMAND,TIMER2CW);
setconfigurationregister(T2CH2CNT,TIMER2TICKS & 0xFF);
setconfigurationregister(T2CH2CNT,TIMER2TICKS >> 8);
}
void INTERRUPT
mytimer()
{
unsigned short flags;
if (Tick == 0)
{
flags = enablespace();
refreshtimer();
disablespace(flags);
/*
// The PC timer executes at 54 millisecond intervals or
// 18.2 times a second. The Watchdog timer must be
// refreshed within half the timeout period specified in
// the count register [(65535ticks / 2) * 15us / 1000ms
// = 491ms]
*/
Tick = (unsigned short)
((long) TIMER2TICKS / 2L * (long) TIMERTICKRESOLUTION /
1000L / 54L) - 1;
}
Tick--;
_chain_intr(previoustimerfunction);
}
/*
// This procedure chains the DOS timer interrupt and turns on the
// watchdog timer. The chained DOS timer handler reprograms the
// watchdog timer with the initial count.
*/
void
installtimer(void (INTERRUPT *newfunction)())
{
unsigned short flags;
_disable();
previoustimerfunction = _dos_getvect(TIMERINT);