소스 검색

Fix M43 without watchdog (#15280)

Bas Stottelaar 5 년 전
부모
커밋
847e4ced11
1개의 변경된 파일11개의 추가작업 그리고 5개의 파일을 삭제
  1. 11
    5
      Marlin/src/gcode/config/M43.cpp

+ 11
- 5
Marlin/src/gcode/config/M43.cpp 파일 보기

@@ -50,6 +50,12 @@
50 50
   #define GET_PIN_MAP_PIN_M43(Q) GET_PIN_MAP_PIN(Q)
51 51
 #endif
52 52
 
53
+inline void _watchdog_reset() {
54
+  #if ENABLED(USE_WATCHDOG)
55
+    watchdog_reset();
56
+  #endif
57
+}
58
+
53 59
 inline void toggle_pins() {
54 60
   const bool ignore_protection = parser.boolval('I');
55 61
   const int repeat = parser.intval('R', 1),
@@ -65,7 +71,7 @@ inline void toggle_pins() {
65 71
       SERIAL_EOL();
66 72
     }
67 73
     else {
68
-      watchdog_reset();
74
+      _watchdog_reset();
69 75
       report_pin_state_extended(pin, ignore_protection, true, "Pulsing   ");
70 76
       #if AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO
71 77
         if (pin == TEENSY_E2) {
@@ -89,10 +95,10 @@ inline void toggle_pins() {
89 95
       {
90 96
         pinMode(pin, OUTPUT);
91 97
         for (int16_t j = 0; j < repeat; j++) {
92
-          watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait);
93
-          watchdog_reset(); extDigitalWrite(pin, 1); safe_delay(wait);
94
-          watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait);
95
-          watchdog_reset();
98
+          _watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait);
99
+          _watchdog_reset(); extDigitalWrite(pin, 1); safe_delay(wait);
100
+          _watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait);
101
+          _watchdog_reset();
96 102
         }
97 103
       }
98 104
     }

Loading…
취소
저장