Skip to content

Commit

Permalink
Fix software reset button press logic for HAS_KILL && SOFT_RESET_ON_KILL
Browse files Browse the repository at this point in the history
  • Loading branch information
skruppy committed Jul 1, 2021
1 parent 415166e commit 753f5ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -890,11 +890,11 @@ void minkill(const bool steppers_off/*=false*/) {
#if EITHER(HAS_KILL, SOFT_RESET_ON_KILL)

// Wait for both KILL and ENC to be released
while (TERN0(HAS_KILL, !kill_state()) || TERN0(SOFT_RESET_ON_KILL, !ui.button_pressed()))
while (TERN0(HAS_KILL, kill_state()) || TERN0(SOFT_RESET_ON_KILL, ui.button_pressed()))
watchdog_refresh();

// Wait for either KILL or ENC press
while (TERN1(HAS_KILL, kill_state()) && TERN1(SOFT_RESET_ON_KILL, ui.button_pressed()))
// Wait for either KILL or ENC to be pressed again
while (TERN1(HAS_KILL, !kill_state()) && TERN1(SOFT_RESET_ON_KILL, !ui.button_pressed()))
watchdog_refresh();

// Reboot the board
Expand Down

0 comments on commit 753f5ba

Please sign in to comment.