Disable watchdog timer when the firmware boots

If it gets this far, the firmware is at least sort of running, so the
watchdog has served its purpose of resetting to the bootloader if
there's invalid firmware flashed to the device.
This commit is contained in:
Doug Brown 2023-08-06 20:35:29 -07:00 committed by Doug Brown
parent 9df4cd0c84
commit d14ca13dd8
1 changed files with 3 additions and 0 deletions

View File

@ -68,6 +68,9 @@ void Board_Init(void)
// Start the timer, prescaler = 48, so 1 MHz
TIMER0->CTL = TIMER_CTL_CNTEN_Msk | (3UL << TIMER_CTL_OPMODE_Pos) | 47;
// Disable WDT now; the main firmware is booted.
WDT->CTL = (6 << WDT_CTL_TOUTSEL_Pos);
}
/** Determines if a brownout was detected at startup