Watchdog cleanup (#15283)

This commit is contained in:
Scott Lahteine
2019-09-29 17:57:29 -05:00
committed by GitHub
parent 24706aedbd
commit 139b7196a0
28 changed files with 73 additions and 97 deletions

View File

@@ -801,29 +801,17 @@ void minkill(const bool steppers_off/*=false*/) {
#if HAS_KILL
// Wait for kill to be released
while (!READ(KILL_PIN)) {
#if ENABLED(USE_WATCHDOG)
watchdog_reset();
#endif
}
while (!READ(KILL_PIN)) watchdog_refresh();
// Wait for kill to be pressed
while (READ(KILL_PIN)) {
#if ENABLED(USE_WATCHDOG)
watchdog_reset();
#endif
}
while (READ(KILL_PIN)) watchdog_refresh();
void (*resetFunc)() = 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
for (;;) watchdog_refresh(); // Wait for reset
#endif // !HAS_KILL
}