|
|
|
@ -764,6 +764,35 @@ void MarlinUI::update() {
|
|
|
|
|
|
|
|
|
|
// If the action button is pressed...
|
|
|
|
|
static bool wait_for_unclick; // = 0
|
|
|
|
|
if (touch_buttons) {
|
|
|
|
|
if (buttons & EN_C) {
|
|
|
|
|
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 (buttons & (EN_A | EN_B)) { // Ignore the encoder if clicked, to prevent "slippage"
|
|
|
|
|
const millis_t ms = millis();
|
|
|
|
|
if (ELAPSED(ms, next_button_update_ms)) {
|
|
|
|
|
next_button_update_ms = ms + 50;
|
|
|
|
|
encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * (ENCODER_PULSES_PER_STEP);
|
|
|
|
|
if (buttons & EN_A) encoderDiff *= -1;
|
|
|
|
|
if (!wait_for_unclick) {
|
|
|
|
|
next_button_update_ms += 250;
|
|
|
|
|
#if HAS_BUZZER
|
|
|
|
|
buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
|
|
|
|
|
#endif
|
|
|
|
|
wait_for_unclick = true; // - Set debounce flag to ignore continous clicks
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
@ -772,6 +801,7 @@ void MarlinUI::update() {
|
|
|
|
|
quick_feedback(); // - Always make a click sound
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else wait_for_unclick = false;
|
|
|
|
|
|
|
|
|
|
#if HAS_DIGITAL_BUTTONS && BUTTON_EXISTS(BACK)
|
|
|
|
@ -784,7 +814,9 @@ void MarlinUI::update() {
|
|
|
|
|
#endif // HAS_LCD_MENU
|
|
|
|
|
|
|
|
|
|
#if ENABLED(INIT_SDCARD_ON_BOOT)
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// SPI SD Card detection (and first card init when the LCD is present)
|
|
|
|
|
//
|
|
|
|
|
const uint8_t sd_status = (uint8_t)IS_SD_INSERTED();
|
|
|
|
|
if (sd_status != lcd_sd_status && detected()) {
|
|
|
|
|
|
|
|
|
|