Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wait_for_user in the Color UI #19694

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Marlin/src/gcode/config/M43.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
#include "../../lcd/extui/ui_api.h"
#endif

#if HAS_RESUME_CONTINUE
#include "../../lcd/ultralcd.h"
#endif

#ifndef GET_PIN_MAP_PIN_M43
#define GET_PIN_MAP_PIN_M43(Q) GET_PIN_MAP_PIN(Q)
#endif
Expand Down Expand Up @@ -362,7 +366,10 @@ void GcodeSuite::M43() {
}
}

if (TERN0(HAS_RESUME_CONTINUE, !wait_for_user)) break;
#if HAS_RESUME_CONTINUE
ui.update();
if (!wait_for_user) break;
#endif

safe_delay(200);
}
Expand Down
12 changes: 12 additions & 0 deletions Marlin/src/lcd/tft/touch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ touch_calibration_t Touch::calibration;
calibrationState Touch::calibration_state = CALIBRATION_NONE;
touch_calibration_point_t Touch::calibration_points[4];
#endif
#if HAS_RESUME_CONTINUE
extern bool wait_for_user;
#endif

void Touch::init() {
calibration_reset();
Expand Down Expand Up @@ -80,6 +83,15 @@ void Touch::idle() {
now = millis();

if (get_point(&_x, &_y)) {
#if HAS_RESUME_CONTINUE
// UI is waiting for a click anywhere?
if (wait_for_user) {
touch_control_type = CLICK;
ui.lcd_clicked = true;
return;
}
#endif

#if LCD_TIMEOUT_TO_STATUS
ui.return_to_status_ms = now + LCD_TIMEOUT_TO_STATUS;
#endif
Expand Down