parent
7d425e41c1
commit
6e945f60b6
|
@ -252,6 +252,8 @@ void initializeConsole() {
|
|||
addConsoleAction("hard_fault", testHardFault);
|
||||
addConsoleAction("threadsinfo", cmd_threads);
|
||||
|
||||
#if HAL_USE_WDG
|
||||
addConsoleActionI("set_watchdog_timeout", startWatchdog);
|
||||
addConsoleActionI("set_watchdog_reset", setWatchdogResetPeriod);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -109,6 +109,7 @@ void startWatchdog(int timeoutMs) {
|
|||
static WDGConfig wdgcfg;
|
||||
wdgcfg.pr = STM32_IWDG_PR_64; // t = (1/32768) * 64 = ~2 ms
|
||||
wdgcfg.rlr = STM32_IWDG_RL((uint32_t)((32.768f / 64.0f) * timeoutMs));
|
||||
efiPrintf("[wdgStart]");
|
||||
wdgStart(&WDGD1, &wdgcfg);
|
||||
#endif // HAL_USE_WDG
|
||||
}
|
||||
|
@ -116,6 +117,7 @@ void startWatchdog(int timeoutMs) {
|
|||
static efitimems_t watchdogResetPeriodMs = 0;
|
||||
|
||||
void setWatchdogResetPeriod(int resetMs) {
|
||||
efiPrintf("[dev] wd %d", resetMs);
|
||||
watchdogResetPeriodMs = (efitimems_t)resetMs;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue