CA-RU150R30XG-3965U-01-W10 User’s Manual
57
◆
Disable WDT
val = Inportb (WD 0x05); // Read current WDT setting
val = val & 0xDF; // Disable WDT by set WD_EN (bit 5) to 0.
Outportb (WD 0x05, val); // Write back WDT setting.
Check WDT Reset Flag
If the system has been reset by WDT function, this flag will set to 1.
val = Inportb (WD 0x05); // Read current WDT setting.
val = val & 0x40; // Check WDTMOUT_STS (bit 6).
if (val) printf (“timeout event occurred”);
else printf (“timeout event not occurred”);
Clear WDT Reset Flag
val = Inportb (WD 0x05); // Read current WDT setting
val = val | 0x40; // Set 1 to WDTMOUT_STS (bit 6);
Outportb (WD 0x05, val); // Write back WDT setting