Skip to content

Commit aae644c

Browse files
rhapsodyvthinkyhead
authored andcommitted
Option to prevent (extra) Watchdog init on STM32 (MarlinFirmware#19693)
1 parent ce830f8 commit aae644c

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

Marlin/src/HAL/STM32/watchdog.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030
#include "watchdog.h"
3131
#include <IWatchdog.h>
3232

33-
void watchdog_init() { IWatchdog.begin(4000000); } // 4 sec timeout
33+
void watchdog_init() {
34+
#if DISABLED(DISABLE_WATCHDOG_INIT)
35+
IWatchdog.begin(4000000); // 4 sec timeout
36+
#endif
37+
}
3438

3539
void HAL_watchdog_refresh() {
3640
IWatchdog.reload();

Marlin/src/HAL/STM32F1/watchdog.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ void watchdogSetup() {
5252
* @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)
5353
*/
5454
void watchdog_init() {
55-
//iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD);
55+
#if DISABLED(DISABLE_WATCHDOG_INIT)
56+
iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD);
57+
#endif
5658
}
5759

5860
#endif // USE_WATCHDOG

Marlin/src/pins/stm32f1/pins_MALYAN_M200.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
#define BOARD_INFO_NAME "Malyan M200"
3434
#endif
3535

36+
// Prevents hanging from an extra watchdog init
37+
#define DISABLE_WATCHDOG_INIT
38+
3639
// Assume Flash EEPROM
3740
#if NO_EEPROM_SELECTED
3841
#define FLASH_EEPROM_EMULATION

0 commit comments

Comments
 (0)