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-06-24 17:00:52 -07:00 committed by Doug Brown
parent 4de119c880
commit 71164460f3

View File

@ -68,6 +68,9 @@ void Board_Init(void)
// Start the timer, prescaler = 48, so 1 MHz // Start the timer, prescaler = 48, so 1 MHz
TIMER0->CTL = TIMER_CTL_CNTEN_Msk | (3UL << TIMER_CTL_OPMODE_Pos) | 47; 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 /** Determines if a brownout was detected at startup