ADLINK aTCA-6155 User Manual

Page 76

Advertising
background image

62

Watchdog Timer

temp = inportb(config_port+1);

temp = temp & 0xFD;//disable WDTO to KBRST#.

if(count_value <= 60)

temp = temp & 0xF7;//second.

//Count the timeout value

if(((count_value>60) && (count_value<=15300)) ||

(count_value > 15300))

{

if(count_value > 15300)

count_value = 15300;

counter = count_value/60;

if((count_value%60)>30)

counter=counter+1;

printf("WDT timeout in %d minutes.",counter);

temp = temp | 0x08;//Count in minute mode.

outportb(config_port+1, temp);

}

else

{

if(count_value == 0)

{

counter = count_value;

printf("WDT is Disabled.");

}

else

{

counter = count_value;

printf("WDT timeout in %d seconds.",counter);

outportb(config_port+1, temp);

}

}

//reset WDT by KB, MS interrupt

outportb(config_port, 0xF7);

temp = inportb(config_port + 1);

temp = temp | 0xC0;//Bit 6 = KB interrupt, Bit 7 = MS

interrupt

outportb(config_port+1, temp);

//Write count value

outportb(config_port, 0xF6);

outportb(config_port+1, counter);

}

Advertising