Skip to content

Commit

Permalink
Reset after kill with a button on the KILL_PIN (#13091)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce j Beare authored and thinkyhead committed Mar 10, 2019
1 parent c36989c commit e4d080e
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions Marlin/src/Marlin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

This comment has been minimized.

Copy link
@p3p

p3p Mar 10, 2019

Member

This is AVR specific reset, needs abstracted

resetFunc(); // Jump to address 0

#else // !HAS_KILL

for (;;) {
#if ENABLED(USE_WATCHDOG)
watchdog_reset();
#endif
} // Wait for reset

#endif // !HAS_KILL
}

/**
Expand Down

0 comments on commit e4d080e

Please sign in to comment.