1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 13:56:24 +00:00

Reset after kill with a button on the KILL_PIN (#13091)

This commit is contained in:
Bruce j Beare 2019-03-10 07:57:38 -07:00 committed by Scott Lahteine
parent c36989c39e
commit e4d080e63c

View File

@ -764,11 +764,34 @@ void minkill() {
suicide();
#endif
while (1) {
#if ENABLED(USE_WATCHDOG)
watchdog_reset();
#endif
} // Wait for reset
#if HAS_KILL
// Wait for kill to be released
while (!READ(KILL_PIN)) {
#if ENABLED(USE_WATCHDOG)
watchdog_reset();
#endif
}
// Wait for kill to be pressed
while (READ(KILL_PIN)) {
#if ENABLED(USE_WATCHDOG)
watchdog_reset();
#endif
}
void(*resetFunc)(void) = 0; // Declare resetFunc() at address 0
resetFunc(); // Jump to address 0
#else // !HAS_KILL
for (;;) {
#if ENABLED(USE_WATCHDOG)
watchdog_reset();
#endif
} // Wait for reset
#endif // !HAS_KILL
}
/**