Fix M43 without watchdog (#15280)

This commit is contained in:
Bas Stottelaar 2019-09-16 23:09:43 +02:00 committed by Scott Lahteine
parent 7e95ee9e4b
commit 847e4ced11

View file

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