Clean up user-wait, SD completion (#17315)
This commit is contained in:
@ -352,6 +352,7 @@ namespace Language_en {
|
||||
PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Print Paused");
|
||||
PROGMEM Language_Str MSG_PRINTING = _UxGT("Printing...");
|
||||
PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Print Aborted");
|
||||
PROGMEM Language_Str MSG_PRINT_DONE = _UxGT("Print Done");
|
||||
PROGMEM Language_Str MSG_NO_MOVE = _UxGT("No Move.");
|
||||
PROGMEM Language_Str MSG_KILLED = _UxGT("KILLED. ");
|
||||
PROGMEM Language_Str MSG_STOPPED = _UxGT("STOPPED. ");
|
||||
|
@ -61,16 +61,14 @@ void _man_probe_pt(const xy_pos_t &xy) {
|
||||
|
||||
float lcd_probe_pt(const xy_pos_t &xy) {
|
||||
_man_probe_pt(xy);
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
ui.defer_status_screen();
|
||||
wait_for_user = true;
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), CONTINUE_STR);
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("Delta Calibration in progress"));
|
||||
#endif
|
||||
while (wait_for_user) idle();
|
||||
wait_for_user_response();
|
||||
ui.goto_previous_screen_no_defer();
|
||||
return current_position.z;
|
||||
}
|
||||
|
@ -776,6 +776,13 @@ void MarlinUI::update() {
|
||||
// If the action button is pressed...
|
||||
static bool wait_for_unclick; // = false
|
||||
|
||||
auto do_click = [&]{
|
||||
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
|
||||
};
|
||||
|
||||
#if ENABLED(TOUCH_BUTTONS)
|
||||
if (touch_buttons) {
|
||||
RESET_STATUS_TIMEOUT();
|
||||
@ -796,12 +803,8 @@ void MarlinUI::update() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!wait_for_unclick && (buttons & EN_C)) { // OK button, 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 (!wait_for_unclick && (buttons & EN_C)) // OK button, if not waiting for a debounce release:
|
||||
do_click();
|
||||
}
|
||||
else // keep wait_for_unclick value
|
||||
|
||||
@ -810,12 +813,7 @@ void MarlinUI::update() {
|
||||
{
|
||||
// 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
|
||||
}
|
||||
if (!wait_for_unclick) do_click(); // Handle the click
|
||||
}
|
||||
else
|
||||
wait_for_unclick = false;
|
||||
|
Reference in New Issue
Block a user