Skip to content

Commit

Permalink
Follow Up MarlinFirmware#14900 - Fix if-else logic
Browse files Browse the repository at this point in the history
  • Loading branch information
robbycandra committed Aug 10, 2019
1 parent e7aba49 commit 6d914e4
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Marlin/src/lcd/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,17 +789,15 @@ void MarlinUI::update() {
}
}
}
else {
//
// Integrated LCD click handling via button_pressed()
//
if (!external_control && button_pressed()) {
if (!wait_for_unclick) { // If not waiting for a debounce release:
wait_for_unclick = true; // - Set debounce flag to ignore continous clicks
lcd_clicked = !wait_for_user && !no_reentry; // - Keep the click if not waiting for a user-click
wait_for_user = false; // - Any click clears wait for user
quick_feedback(); // - Always make a click sound
}
else if (!external_control && button_pressed()) {
if (!wait_for_unclick) { // If not waiting for a debounce release:
wait_for_unclick = true; // - Set debounce flag to ignore continous clicks
lcd_clicked = !wait_for_user && !no_reentry; // - Keep the click if not waiting for a user-click
wait_for_user = false; // - Any click clears wait for user
quick_feedback(); // - Always make a click sound
}
}
else wait_for_unclick = false;
Expand Down

0 comments on commit 6d914e4

Please sign in to comment.