diff --git a/Marlin/src/gcode/config/M43.cpp b/Marlin/src/gcode/config/M43.cpp index 7b048f219..e26f6d8ee 100644 --- a/Marlin/src/gcode/config/M43.cpp +++ b/Marlin/src/gcode/config/M43.cpp @@ -50,6 +50,12 @@ #define GET_PIN_MAP_PIN_M43(Q) GET_PIN_MAP_PIN(Q) #endif +inline void _watchdog_reset() { + #if ENABLED(USE_WATCHDOG) + watchdog_reset(); + #endif +} + inline void toggle_pins() { const bool ignore_protection = parser.boolval('I'); const int repeat = parser.intval('R', 1), @@ -65,7 +71,7 @@ inline void toggle_pins() { SERIAL_EOL(); } else { - watchdog_reset(); + _watchdog_reset(); report_pin_state_extended(pin, ignore_protection, true, "Pulsing "); #if AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO if (pin == TEENSY_E2) { @@ -89,10 +95,10 @@ inline void toggle_pins() { { pinMode(pin, OUTPUT); for (int16_t j = 0; j < repeat; j++) { - watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait); - watchdog_reset(); extDigitalWrite(pin, 1); safe_delay(wait); - watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait); - watchdog_reset(); + _watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait); + _watchdog_reset(); extDigitalWrite(pin, 1); safe_delay(wait); + _watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait); + _watchdog_reset(); } } }