Browse Source

Option to prevent (extra) Watchdog init on STM32 (#19693)

Victor Oliveira 3 years ago
parent
commit
aae644c507

+ 5
- 1
Marlin/src/HAL/STM32/watchdog.cpp View File

@@ -30,7 +30,11 @@
30 30
   #include "watchdog.h"
31 31
   #include <IWatchdog.h>
32 32
 
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
+  }
34 38
 
35 39
   void HAL_watchdog_refresh() {
36 40
     IWatchdog.reload();

+ 3
- 1
Marlin/src/HAL/STM32F1/watchdog.cpp View File

@@ -52,7 +52,9 @@ void watchdogSetup() {
52 52
  * @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)
53 53
  */
54 54
 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
56 58
 }
57 59
 
58 60
 #endif // USE_WATCHDOG

+ 3
- 0
Marlin/src/pins/stm32f1/pins_MALYAN_M200.h View File

@@ -33,6 +33,9 @@
33 33
   #define BOARD_INFO_NAME "Malyan M200"
34 34
 #endif
35 35
 
36
+// Prevents hanging from an extra watchdog init
37
+#define DISABLE_WATCHDOG_INIT
38
+
36 39
 // Assume Flash EEPROM
37 40
 #if NO_EEPROM_SELECTED
38 41
   #define FLASH_EEPROM_EMULATION

Loading…
Cancel
Save