Option to prevent (extra) Watchdog init on STM32 (#19693)
This commit is contained in:
parent
18dd0d00a6
commit
639b0b8f50
|
@ -30,7 +30,11 @@
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
#include <IWatchdog.h>
|
#include <IWatchdog.h>
|
||||||
|
|
||||||
void watchdog_init() { IWatchdog.begin(4000000); } // 4 sec timeout
|
void watchdog_init() {
|
||||||
|
#if DISABLED(DISABLE_WATCHDOG_INIT)
|
||||||
|
IWatchdog.begin(4000000); // 4 sec timeout
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void HAL_watchdog_refresh() {
|
void HAL_watchdog_refresh() {
|
||||||
IWatchdog.reload();
|
IWatchdog.reload();
|
||||||
|
|
|
@ -52,7 +52,9 @@ void watchdogSetup() {
|
||||||
* @details The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and 625 reload value (counts down to 0)
|
* @details The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and 625 reload value (counts down to 0)
|
||||||
*/
|
*/
|
||||||
void watchdog_init() {
|
void watchdog_init() {
|
||||||
//iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD);
|
#if DISABLED(DISABLE_WATCHDOG_INIT)
|
||||||
|
iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // USE_WATCHDOG
|
#endif // USE_WATCHDOG
|
||||||
|
|
|
@ -33,6 +33,9 @@
|
||||||
#define BOARD_INFO_NAME "Malyan M200"
|
#define BOARD_INFO_NAME "Malyan M200"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Prevents hanging from an extra watchdog init
|
||||||
|
#define DISABLE_WATCHDOG_INIT
|
||||||
|
|
||||||
// Assume Flash EEPROM
|
// Assume Flash EEPROM
|
||||||
#if NO_EEPROM_SELECTED
|
#if NO_EEPROM_SELECTED
|
||||||
#define FLASH_EEPROM_EMULATION
|
#define FLASH_EEPROM_EMULATION
|
||||||
|
|
Loading…
Reference in a new issue