1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-23 20:18:52 +00:00

🐛 Fix HAS_KILL && SOFT_RESET_ON_KILL soft reset button logic (#22269)

This commit is contained in:
Skruppy 2021-07-10 01:25:47 +02:00 committed by GitHub
parent 3ba5eda0b2
commit e487900069
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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