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
   #include "../../lcd/extui/ui_api.h"
46
   #include "../../lcd/extui/ui_api.h"
47
 #endif
47
 #endif
48
 
48
 
49
+#if HAS_RESUME_CONTINUE
50
+  #include "../../lcd/ultralcd.h"
51
+#endif
52
+
49
 #ifndef GET_PIN_MAP_PIN_M43
53
 #ifndef GET_PIN_MAP_PIN_M43
50
   #define GET_PIN_MAP_PIN_M43(Q) GET_PIN_MAP_PIN(Q)
54
   #define GET_PIN_MAP_PIN_M43(Q) GET_PIN_MAP_PIN(Q)
51
 #endif
55
 #endif
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
       safe_delay(200);
374
       safe_delay(200);
368
     }
375
     }

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

50
   calibrationState Touch::calibration_state = CALIBRATION_NONE;
50
   calibrationState Touch::calibration_state = CALIBRATION_NONE;
51
   touch_calibration_point_t Touch::calibration_points[4];
51
   touch_calibration_point_t Touch::calibration_points[4];
52
 #endif
52
 #endif
53
+#if HAS_RESUME_CONTINUE
54
+  extern bool wait_for_user;
55
+#endif
53
 
56
 
54
 void Touch::init() {
57
 void Touch::init() {
55
   calibration_reset();
58
   calibration_reset();
80
   now = millis();
83
   now = millis();
81
 
84
 
82
   if (get_point(&_x, &_y)) {
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
     #if LCD_TIMEOUT_TO_STATUS
95
     #if LCD_TIMEOUT_TO_STATUS
84
       ui.return_to_status_ms = now + LCD_TIMEOUT_TO_STATUS;
96
       ui.return_to_status_ms = now + LCD_TIMEOUT_TO_STATUS;
85
     #endif
97
     #endif

Loading…
Cancel
Save