HAL support for 8s watchdog

This commit is contained in:
Scott Lahteine
2020-11-04 15:08:31 -06:00
parent 2a78fe0f81
commit 4fe1adc383
14 changed files with 82 additions and 73 deletions

View File

@ -25,23 +25,26 @@
#if ENABLED(USE_WATCHDOG)
#include "../../inc/MarlinConfig.h"
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
#include "watchdog.h"
#include <IWatchdog.h>
#include "../../inc/MarlinConfig.h"
void watchdog_init() {
#if DISABLED(DISABLE_WATCHDOG_INIT)
IWatchdog.begin(4000000); // 4 sec timeout
#endif
}
#include "watchdog.h"
#include <IWatchdog.h>
void HAL_watchdog_refresh() {
IWatchdog.reload();
#if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
TOGGLE(LED_PIN); // heartbeat indicator
#endif
}
void watchdog_init() {
#if DISABLED(DISABLE_WATCHDOG_INIT)
IWatchdog.begin(WDT_TIMEOUT_US);
#endif
}
void HAL_watchdog_refresh() {
IWatchdog.reload();
#if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
TOGGLE(LED_PIN); // heartbeat indicator
#endif
}
#endif // USE_WATCHDOG
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC