Browse Source

Add D100 Watchdog Test (#19697)

vanilla_fb_2.0.x
Jason Smith 4 years ago
committed by GitHub
parent
commit
f5139f8bf4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      Marlin/src/gcode/gcode_d.cpp

18
Marlin/src/gcode/gcode_d.cpp

@ -25,8 +25,10 @@
#include "gcode.h" #include "gcode.h"
#include "../module/settings.h" #include "../module/settings.h"
#include "../module/temperature.h"
#include "../libs/hex_print.h" #include "../libs/hex_print.h"
#include "../HAL/shared/eeprom_if.h" #include "../HAL/shared/eeprom_if.h"
#include "../HAL/shared/Delay.h"
/** /**
* Dn: G-code for development and testing * Dn: G-code for development and testing
@ -84,6 +86,7 @@
} }
} break; } break;
#if ENABLED(EEPROM_SETTINGS)
case 3: { // D3 Read / Write EEPROM case 3: { // D3 Read / Write EEPROM
uint8_t *pointer = parser.hex_adr_val('A'); uint8_t *pointer = parser.hex_adr_val('A');
uint16_t len = parser.ushortval('C', 1); uint16_t len = parser.ushortval('C', 1);
@ -128,6 +131,7 @@
SERIAL_EOL(); SERIAL_EOL();
} }
} break; } break;
#endif
case 4: { // D4 Read / Write PIN case 4: { // D4 Read / Write PIN
// const uint8_t pin = parser.byteval('P'); // const uint8_t pin = parser.byteval('P');
@ -167,6 +171,20 @@
SERIAL_EOL(); SERIAL_EOL();
} }
} break; } break;
case 100: { // D100 Disable heaters and attempt a hard hang (Watchdog Test)
SERIAL_ECHOLN("Disabling heaters and attempting to trigger Watchdog");
SERIAL_ECHOLN("(USE_WATCHDOG " TERN(USE_WATCHDOG, "ENABLED", "DISABLED") ")");
thermalManager.disable_all_heaters();
delay(1000); // Allow time to print
DISABLE_ISRS();
// Use a low-level delay that does not rely on interrupts to function
// Do not spin forever, to avoid thermal risks if heaters are enabled and
// watchdog does not work.
DELAY_US(10000000);
ENABLE_ISRS();
SERIAL_ECHOLN("FAILURE: Watchdog did not trigger board reset.");
}
} }
} }

Loading…
Cancel
Save