Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable Watchdog Init call for STM32 #19693

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Marlin/src/HAL/STM32/watchdog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
#include "watchdog.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() {
IWatchdog.reload();
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/HAL/STM32F1/watchdog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*/
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
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/pins/stm32f1/pins_MALYAN_M200.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
#define BOARD_INFO_NAME "Malyan M200"
#endif

// Prevents hanging from an extra watchdog init
#define DISABLE_WATCHDOG_INIT

// Assume Flash EEPROM
#if NO_EEPROM_SELECTED
#define FLASH_EEPROM_EMULATION
Expand Down