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
parent 1d78da958c
commit 9476de85b4
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