Browse Source

Implement wait_for_user for Color UI (#19694)

Victor Oliveira 3 years ago
parent
commit
35c40bc376
2 changed files with 20 additions and 1 deletions
  1. 8
    1
      Marlin/src/gcode/config/M43.cpp
  2. 12
    0
      Marlin/src/lcd/tft/touch.cpp

+ 8
- 1
Marlin/src/gcode/config/M43.cpp View File

@@ -46,6 +46,10 @@
46 46
   #include "../../lcd/extui/ui_api.h"
47 47
 #endif
48 48
 
49
+#if HAS_RESUME_CONTINUE
50
+  #include "../../lcd/ultralcd.h"
51
+#endif
52
+
49 53
 #ifndef GET_PIN_MAP_PIN_M43
50 54
   #define GET_PIN_MAP_PIN_M43(Q) GET_PIN_MAP_PIN(Q)
51 55
 #endif
@@ -362,7 +366,10 @@ void GcodeSuite::M43() {
362 366
         }
363 367
       }
364 368
 
365
-      if (TERN0(HAS_RESUME_CONTINUE, !wait_for_user)) break;
369
+      #if HAS_RESUME_CONTINUE
370
+        ui.update();
371
+        if (!wait_for_user) break;
372
+      #endif
366 373
 
367 374
       safe_delay(200);
368 375
     }

+ 12
- 0
Marlin/src/lcd/tft/touch.cpp View File

@@ -50,6 +50,9 @@ touch_calibration_t Touch::calibration;
50 50
   calibrationState Touch::calibration_state = CALIBRATION_NONE;
51 51
   touch_calibration_point_t Touch::calibration_points[4];
52 52
 #endif
53
+#if HAS_RESUME_CONTINUE
54
+  extern bool wait_for_user;
55
+#endif
53 56
 
54 57
 void Touch::init() {
55 58
   calibration_reset();
@@ -80,6 +83,15 @@ void Touch::idle() {
80 83
   now = millis();
81 84
 
82 85
   if (get_point(&_x, &_y)) {
86
+    #if HAS_RESUME_CONTINUE
87
+      // UI is waiting for a click anywhere?
88
+      if (wait_for_user) {
89
+        touch_control_type = CLICK;
90
+        ui.lcd_clicked = true;
91
+        return;
92
+      }
93
+    #endif
94
+
83 95
     #if LCD_TIMEOUT_TO_STATUS
84 96
       ui.return_to_status_ms = now + LCD_TIMEOUT_TO_STATUS;
85 97
     #endif

Loading…
Cancel
Save