Browse Source

Fix build with and without TOUCH_BUTTONS (#14912)

pull/1/head
Tanguy Pruvot 5 years ago
committed by Scott Lahteine
parent
commit
0745d48993
  1. 9
      Marlin/src/lcd/ultralcd.cpp

9
Marlin/src/lcd/ultralcd.cpp

@ -764,15 +764,14 @@ void MarlinUI::update() {
// If the action button is pressed... // If the action button is pressed...
static bool wait_for_unclick; // = 0 static bool wait_for_unclick; // = 0
#if ENABLED(TOUCH_BUTTONS)
if (touch_buttons) { if (touch_buttons) {
if (buttons & EN_C) { if (!wait_for_unclick && (buttons & EN_C)) { // If not waiting for a debounce release:
if (!wait_for_unclick) { // If not waiting for a debounce release:
wait_for_unclick = true; // - Set debounce flag to ignore continous clicks 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 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 wait_for_user = false; // - Any click clears wait for user
quick_feedback(); // - Always make a click sound quick_feedback(); // - Always make a click sound
} }
}
else if (buttons & (EN_A | EN_B)) { // Ignore the encoder if clicked, to prevent "slippage" else if (buttons & (EN_A | EN_B)) { // Ignore the encoder if clicked, to prevent "slippage"
const millis_t ms = millis(); const millis_t ms = millis();
if (ELAPSED(ms, next_button_update_ms)) { if (ELAPSED(ms, next_button_update_ms)) {
@ -789,7 +788,8 @@ void MarlinUI::update() {
} }
} }
} }
else { else
#endif //TOUCH_BUTTONS
// //
// Integrated LCD click handling via button_pressed() // Integrated LCD click handling via button_pressed()
// //
@ -801,7 +801,6 @@ void MarlinUI::update() {
quick_feedback(); // - Always make a click sound quick_feedback(); // - Always make a click sound
} }
} }
}
else wait_for_unclick = false; else wait_for_unclick = false;
#if HAS_DIGITAL_BUTTONS && BUTTON_EXISTS(BACK) #if HAS_DIGITAL_BUTTONS && BUTTON_EXISTS(BACK)

Loading…
Cancel
Save