Quellcode durchsuchen

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

Victor Oliveira vor 3 Jahren
Ursprung
Commit
aae644c507

+ 5
- 1
Marlin/src/HAL/STM32/watchdog.cpp Datei anzeigen

30
   #include "watchdog.h"
30
   #include "watchdog.h"
31
   #include <IWatchdog.h>
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
   void HAL_watchdog_refresh() {
39
   void HAL_watchdog_refresh() {
36
     IWatchdog.reload();
40
     IWatchdog.reload();

+ 3
- 1
Marlin/src/HAL/STM32F1/watchdog.cpp Datei anzeigen

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)
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
 void watchdog_init() {
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
 #endif // USE_WATCHDOG
60
 #endif // USE_WATCHDOG

+ 3
- 0
Marlin/src/pins/stm32f1/pins_MALYAN_M200.h Datei anzeigen

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

Laden…
Abbrechen
Speichern