Sfoglia il codice sorgente

Fix GTM32_PRO_VB Serial and HAL via watchdog (#12753)

Move `watchdog_reset` from `.h` to `.cpp` to eliminate the need to include `MarlinConfig.h` in a HAL-related file.
Phr3d13 6 anni fa
parent
commit
01f75591c6

+ 7
- 0
Marlin/src/HAL/HAL_STM32F1/watchdog_STM32F1.cpp Vedi File

33
 #include <libmaple/iwdg.h>
33
 #include <libmaple/iwdg.h>
34
 #include "watchdog_STM32F1.h"
34
 #include "watchdog_STM32F1.h"
35
 
35
 
36
+void watchdog_reset() {
37
+  #if PIN_EXISTS(LED)
38
+    TOGGLE(LED_PIN);  // heartbeat indicator
39
+  #endif
40
+  iwdg_feed();
41
+}
42
+
36
 void watchdogSetup(void) {
43
 void watchdogSetup(void) {
37
   // do whatever. don't remove this function.
44
   // do whatever. don't remove this function.
38
 }
45
 }

+ 1
- 8
Marlin/src/HAL/HAL_STM32F1/watchdog_STM32F1.h Vedi File

27
 
27
 
28
 #include <libmaple/iwdg.h>
28
 #include <libmaple/iwdg.h>
29
 
29
 
30
-#include "../../inc/MarlinConfig.h"
31
-
32
 /**
30
 /**
33
  *  The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and
31
  *  The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and
34
  *  625 reload value (counts down to 0)
32
  *  625 reload value (counts down to 0)
43
 
41
 
44
 // Reset watchdog. MUST be called at least every 4 seconds after the
42
 // Reset watchdog. MUST be called at least every 4 seconds after the
45
 // first watchdog_init or STM32F1 will reset.
43
 // first watchdog_init or STM32F1 will reset.
46
-inline void watchdog_reset() {
44
+void watchdog_reset();
47
-  #if PIN_EXISTS(LED)
48
-    TOGGLE(LED_PIN);  // heart beat indicator
49
-  #endif
50
-  iwdg_feed();
51
-}

Loading…
Annulla
Salva