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

@ -33,6 +33,13 @@
#include <libmaple/iwdg.h>
#include "watchdog.h"
/**
* The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and
* 625 reload value (counts down to 0)
* use 1250 for 8 seconds
*/
#define STM32F1_WD_RELOAD TERN(WATCHDOG_DURATION_8S, 1250, 625) // 4 or 8 second timeout
void HAL_watchdog_refresh() {
#if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
TOGGLE(LED_PIN); // heartbeat indicator

View File

@ -27,13 +27,6 @@
#include <libmaple/iwdg.h>
/**
* The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and
* 625 reload value (counts down to 0)
* use 1250 for 8 seconds
*/
#define STM32F1_WD_RELOAD 625
// Arduino STM32F1 core now has watchdog support
// Initialize watchdog with a 4 second countdown time