Skip to content

Commit b8219fd

Browse files
thinkyheadeoyilmaz
authored andcommittedNov 21, 2023
🚸 Minor touch calibration improvement (MarlinFirmware#26445)
1 parent e2b0b18 commit b8219fd

20 files changed

+172
-169
lines changed
 

‎Marlin/src/HAL/LPC1768/tft/xpt2046.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,11 @@ bool XPT2046::isTouched() {
7474
);
7575
}
7676

77-
bool XPT2046::getRawPoint(int16_t *x, int16_t *y) {
78-
if (isBusy()) return false;
79-
if (!isTouched()) return false;
77+
bool XPT2046::getRawPoint(int16_t * const x, int16_t * const y) {
78+
if (isBusy() || !isTouched()) return false;
8079
*x = getRawData(XPT2046_X);
8180
*y = getRawData(XPT2046_Y);
82-
return isTouched();
81+
return true;
8382
}
8483

8584
uint16_t XPT2046::getRawData(const XPTCoordinate coordinate) {

‎Marlin/src/HAL/LPC1768/tft/xpt2046.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ class XPT2046 {
7979
#endif
8080

8181
static void init();
82-
static bool getRawPoint(int16_t *x, int16_t *y);
82+
static bool getRawPoint(int16_t * const x, int16_t * const y);
8383
};

‎Marlin/src/HAL/NATIVE_SIM/tft/xpt2046.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ class XPT2046 {
7676
#endif
7777

7878
static void init();
79-
static bool getRawPoint(int16_t *x, int16_t *y);
79+
static bool getRawPoint(int16_t * const x, int16_t * const y);
8080
};

‎Marlin/src/HAL/STM32/tft/gt911.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ bool GT911::getFirstTouchPoint(int16_t *x, int16_t *y) {
189189
return false;
190190
}
191191

192-
bool GT911::getPoint(int16_t *x, int16_t *y) {
193-
static bool touched = 0;
192+
bool GT911::getRawPoint(int16_t * const x, int16_t * const y) {
193+
static bool touched = false;
194194
static int16_t read_x = 0, read_y = 0;
195195
static millis_t next_time = 0;
196196

‎Marlin/src/HAL/STM32/tft/gt911.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,5 @@ class GT911 {
9292
public:
9393
static void init();
9494
static bool getFirstTouchPoint(int16_t *x, int16_t *y);
95-
static bool getPoint(int16_t *x, int16_t *y);
95+
static bool getRawPoint(int16_t * const x, int16_t * const y);
9696
};

‎Marlin/src/HAL/STM32/tft/xpt2046.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,11 @@ bool XPT2046::isTouched() {
119119
);
120120
}
121121

122-
bool XPT2046::getRawPoint(int16_t *x, int16_t *y) {
123-
if (isBusy()) return false;
124-
if (!isTouched()) return false;
122+
bool XPT2046::getRawPoint(int16_t * const x, int16_t * const y) {
123+
if (isBusy() || !isTouched()) return false;
125124
*x = getRawData(XPT2046_X);
126125
*y = getRawData(XPT2046_Y);
127-
return isTouched();
126+
return true;
128127
}
129128

130129
uint16_t XPT2046::getRawData(const XPTCoordinate coordinate) {

‎Marlin/src/HAL/STM32/tft/xpt2046.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@ class XPT2046 {
8181

8282
public:
8383
static void init();
84-
static bool getRawPoint(int16_t *x, int16_t *y);
84+
static bool getRawPoint(int16_t * const x, int16_t * const y);
8585
};

‎Marlin/src/HAL/STM32F1/tft/xpt2046.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,11 @@ bool XPT2046::isTouched() {
8686
);
8787
}
8888

89-
bool XPT2046::getRawPoint(int16_t *x, int16_t *y) {
90-
if (isBusy()) return false;
91-
if (!isTouched()) return false;
89+
bool XPT2046::getRawPoint(int16_t * const x, int16_t * const y) {
90+
if (isBusy() || !isTouched()) return false;
9291
*x = getRawData(XPT2046_X);
9392
*y = getRawData(XPT2046_Y);
94-
return isTouched();
93+
return true;
9594
}
9695

9796
uint16_t XPT2046::getRawData(const XPTCoordinate coordinate) {

‎Marlin/src/HAL/STM32F1/tft/xpt2046.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ class XPT2046 {
7979
#endif
8080

8181
static void init();
82-
static bool getRawPoint(int16_t *x, int16_t *y);
82+
static bool getRawPoint(int16_t * const x, int16_t * const y);
8383
};

‎Marlin/src/core/debug_out.h

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#undef DEBUG_ECHO_MSG
4141
#undef DEBUG_ERROR_MSG
4242
#undef DEBUG_WARN_MSG
43+
#undef DEBUG_ECHO_TERNARY
4344
#undef DEBUG_EOL
4445
#undef DEBUG_FLUSH
4546
#undef DEBUG_POS
@@ -67,6 +68,7 @@
6768
#define DEBUG_ECHO_MSG SERIAL_ECHO_MSG
6869
#define DEBUG_ERROR_MSG SERIAL_ERROR_MSG
6970
#define DEBUG_WARN_MSG SERIAL_WARN_MSG
71+
#define DEBUG_ECHO_TERNARY SERIAL_ECHO_TERNARY
7072
#define DEBUG_EOL SERIAL_EOL
7173
#define DEBUG_FLUSH SERIAL_FLUSH
7274
#define DEBUG_POS SERIAL_POS
@@ -90,6 +92,7 @@
9092
#define DEBUG_ECHO_MSG(...) NOOP
9193
#define DEBUG_ERROR_MSG(...) NOOP
9294
#define DEBUG_WARN_MSG(...) NOOP
95+
#define DEBUG_ECHO_TERNARY(...) NOOP
9396
#define DEBUG_EOL() NOOP
9497
#define DEBUG_FLUSH() NOOP
9598
#define DEBUG_POS(...) NOOP

‎Marlin/src/lcd/e3v2/jyersui/dwin.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -389,20 +389,20 @@ class TextScroller {
389389

390390
// Draw value text on
391391
if (viewer_print_value) {
392-
int8_t offset_x, offset_y = cell_height_px / 2 - 6;
392+
xy_int8_t offset { 0, cell_height_px / 2 - 6 };
393393
if (isnan(bedlevel.z_values[x][y])) { // undefined
394-
dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + cell_width_px / 2 - 5, start_y_px + offset_y, F("X"));
394+
dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + cell_width_px / 2 - 5, start_y_px + offset.y, F("X"));
395395
}
396396
else { // has value
397397
MString<12> msg;
398398
if (GRID_MAX_POINTS_X < 10)
399399
msg.set(p_float_t(abs(bedlevel.z_values[x][y]), 2));
400400
else
401401
msg.setf(F("%02i"), uint16_t(abs(bedlevel.z_values[x][y] - int16_t(bedlevel.z_values[x][y])) * 100));
402-
offset_x = cell_width_px / 2 - 3 * msg.length() - 2;
402+
offset.x = cell_width_px / 2 - 3 * msg.length() - 2;
403403
if (GRID_MAX_POINTS_X >= 10)
404-
dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px - 2 + offset_x, start_y_px + offset_y /*+ square / 2 - 6*/, F("."));
405-
dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + 1 + offset_x, start_y_px + offset_y /*+ square / 2 - 6*/, msg);
404+
dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px - 2 + offset.x, start_y_px + offset.y /*+ square / 2 - 6*/, F("."));
405+
dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + 1 + offset.x, start_y_px + offset.y /*+ square / 2 - 6*/, msg);
406406
}
407407
safe_delay(10);
408408
LCD_SERIAL.flushTX();

‎Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -247,20 +247,20 @@ bool BedLevelTools::meshValidate() {
247247
// Draw value text on
248248
const uint8_t fs = DWINUI::fontWidth(meshfont);
249249
if (viewer_print_value) {
250-
int8_t offset_x, offset_y = cell_height_px / 2 - fs;
250+
xy_int8_t offset { 0, cell_height_px / 2 - fs };
251251
if (isnan(bedlevel.z_values[x][y])) { // undefined
252-
dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + cell_width_px / 2 - 5, start_y_px + offset_y, F("X"));
252+
dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + cell_width_px / 2 - 5, start_y_px + offset.y, F("X"));
253253
}
254254
else { // has value
255255
MString<12> msg;
256256
if ((GRID_MAX_POINTS_X) < TERN(TJC_DISPLAY, 8, 10))
257257
msg.set(p_float_t(abs(bedlevel.z_values[x][y]), 2));
258258
else
259259
msg.setf(F("%02i"), uint16_t(abs(bedlevel.z_values[x][y] - int16_t(bedlevel.z_values[x][y])) * 100));
260-
offset_x = cell_width_px / 2 - (fs / 2) * msg.length() - 2;
260+
offset.x = cell_width_px / 2 - (fs / 2) * msg.length() - 2;
261261
if ((GRID_MAX_POINTS_X) >= TERN(TJC_DISPLAY, 8, 10))
262-
dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px - 2 + offset_x, start_y_px + offset_y, F("."));
263-
dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + 1 + offset_x, start_y_px + offset_y, msg);
262+
dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px - 2 + offset.x, start_y_px + offset.y, F("."));
263+
dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + 1 + offset.x, start_y_px + offset.y, msg);
264264
}
265265
safe_delay(10);
266266
LCD_SERIAL.flushTX();

‎Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp

+13-25
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ XPT2046 touch;
5555
#include "../../../module/probe.h"
5656
#endif
5757

58+
#include "../../tft_io/touch_calibration.h"
5859
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
59-
#include "../../tft_io/touch_calibration.h"
6060
#include "draw_touch_calibration.h"
6161
#endif
6262

@@ -305,45 +305,33 @@ uint16_t getTickDiff(const uint16_t curTick, const uint16_t lastTick) {
305305
return (TICK_CYCLE) * (lastTick <= curTick ? (curTick - lastTick) : (0xFFFFFFFF - lastTick + curTick));
306306
}
307307

308-
static bool get_point(int16_t *x, int16_t *y) {
309-
if (!touch.getRawPoint(x, y)) return false;
308+
static bool get_point(xy_int_t &point) {
309+
if (!touch.getRawPoint(&point.x, &point.y)) return false;
310310

311311
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
312312
const calibrationState state = touch_calibration.get_calibration_state();
313313
if (WITHIN(state, CALIBRATION_TOP_LEFT, CALIBRATION_BOTTOM_LEFT)) {
314-
if (touch_calibration.handleTouch(*x, *y)) lv_update_touch_calibration_screen();
314+
if (touch_calibration.handleTouch(point)) lv_update_touch_calibration_screen();
315315
return false;
316316
}
317-
*x = int16_t((int32_t(*x) * touch_calibration.calibration.x) >> 16) + touch_calibration.calibration.offset_x;
318-
*y = int16_t((int32_t(*y) * touch_calibration.calibration.y) >> 16) + touch_calibration.calibration.offset_y;
319-
#else
320-
*x = int16_t((int32_t(*x) * TOUCH_CALIBRATION_X) >> 16) + TOUCH_OFFSET_X;
321-
*y = int16_t((int32_t(*y) * TOUCH_CALIBRATION_Y) >> 16) + TOUCH_OFFSET_Y;
322317
#endif
323318

319+
point.x = int16_t((int32_t(point.x) * _TOUCH_CALIBRATION_X) >> 16) + _TOUCH_OFFSET_X;
320+
point.y = int16_t((int32_t(point.y) * _TOUCH_CALIBRATION_Y) >> 16) + _TOUCH_OFFSET_Y;
321+
324322
return true;
325323
}
326324

327325
bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) {
328-
static int16_t last_x = 0, last_y = 0;
329-
if (get_point(&last_x, &last_y)) {
330-
#if TFT_ROTATION == TFT_ROTATE_180
331-
data->point.x = TFT_WIDTH - last_x;
332-
data->point.y = TFT_HEIGHT - last_y;
333-
#else
334-
data->point.x = last_x;
335-
data->point.y = last_y;
336-
#endif
326+
static xy_int_t last { 0, 0 };
327+
if (get_point(last)) {
328+
data->point.x = (TFT_ROTATION == TFT_ROTATE_180) ? TFT_WIDTH - last.x : last.x;
329+
data->point.y = (TFT_ROTATION == TFT_ROTATE_180) ? TFT_HEIGHT - last.y : last.y;
337330
data->state = LV_INDEV_STATE_PR;
338331
}
339332
else {
340-
#if TFT_ROTATION == TFT_ROTATE_180
341-
data->point.x = TFT_WIDTH - last_x;
342-
data->point.y = TFT_HEIGHT - last_y;
343-
#else
344-
data->point.x = last_x;
345-
data->point.y = last_y;
346-
#endif
333+
data->point.x = (TFT_ROTATION == TFT_ROTATE_180) ? TFT_WIDTH - last.x : last.x;
334+
data->point.y = (TFT_ROTATION == TFT_ROTATE_180) ? TFT_HEIGHT - last.y : last.y;
347335
data->state = LV_INDEV_STATE_REL;
348336
}
349337
return false; // Return `false` since no data is buffering or left to read

‎Marlin/src/lcd/marlinui.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ void MarlinUI::init() {
408408

409409
#if HAS_TOUCH_BUTTONS
410410
uint8_t MarlinUI::touch_buttons;
411-
uint8_t MarlinUI::repeat_delay;
411+
uint16_t MarlinUI::repeat_delay;
412412
#endif
413413

414414
#if ANY(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)

‎Marlin/src/lcd/marlinui.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ class MarlinUI {
660660

661661
#if HAS_TOUCH_BUTTONS
662662
static uint8_t touch_buttons;
663-
static uint8_t repeat_delay;
663+
static uint16_t repeat_delay;
664664
#else
665665
static constexpr uint8_t touch_buttons = 0;
666666
#endif

‎Marlin/src/lcd/tft/touch.cpp

+32-34
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "tft.h"
4040

4141
bool Touch::enabled = true;
42-
int16_t Touch::x, Touch::y;
42+
xy_int_t Touch::point;
4343
touch_control_t Touch::controls[];
4444
touch_control_t *Touch::current_control;
4545
uint16_t Touch::controls_count;
@@ -67,26 +67,22 @@ void Touch::add_control(TouchControlType type, uint16_t x, uint16_t y, uint16_t
6767
if (controls_count == MAX_CONTROLS) return;
6868

6969
controls[controls_count].type = type;
70-
controls[controls_count].x = x;
71-
controls[controls_count].y = y;
72-
controls[controls_count].width = width;
73-
controls[controls_count].height = height;
70+
controls[controls_count].pos.set(x, y);
71+
controls[controls_count].size.set(width, height);
7472
controls[controls_count].data = data;
7573
controls_count++;
7674
}
7775

7876
void Touch::idle() {
79-
uint16_t i;
80-
int16_t _x, _y;
81-
8277
if (!enabled) return;
8378

8479
// Return if Touch::idle is called within the same millisecond
8580
const millis_t now = millis();
8681
if (now <= next_touch_ms) return;
8782
next_touch_ms = now;
8883

89-
if (get_point(&_x, &_y)) {
84+
xy_int_t got_point;
85+
if (get_point(got_point)) {
9086
#if HAS_RESUME_CONTINUE
9187
// UI is waiting for a click anywhere?
9288
if (wait_for_user) {
@@ -110,19 +106,24 @@ void Touch::idle() {
110106
if (time_to_hold == 0) time_to_hold = now + MINIMUM_HOLD_TIME;
111107
if (PENDING(now, time_to_hold)) return;
112108

113-
if (x != 0 && y != 0) {
109+
if (bool(point)) {
114110
if (current_control) {
115-
if (WITHIN(x, current_control->x - FREE_MOVE_RANGE, current_control->x + current_control->width + FREE_MOVE_RANGE) && WITHIN(y, current_control->y - FREE_MOVE_RANGE, current_control->y + current_control->height + FREE_MOVE_RANGE)) {
116-
LIMIT(x, current_control->x, current_control->x + current_control->width);
117-
LIMIT(y, current_control->y, current_control->y + current_control->height);
111+
if ( WITHIN(point.x, current_control->pos.x - FREE_MOVE_RANGE, current_control->pos.x + current_control->size.x + FREE_MOVE_RANGE)
112+
&& WITHIN(point.y, current_control->pos.y - FREE_MOVE_RANGE, current_control->pos.y + current_control->size.y + FREE_MOVE_RANGE)
113+
) {
114+
LIMIT(point.x, current_control->pos.x, current_control->pos.x + current_control->size.x);
115+
LIMIT(point.y, current_control->pos.y, current_control->pos.y + current_control->size.y);
118116
touch(current_control);
119117
}
120118
else
121119
current_control = nullptr;
122120
}
123121
else {
124-
for (i = 0; i < controls_count; i++) {
125-
if ((WITHIN(x, controls[i].x, controls[i].x + controls[i].width) && WITHIN(y, controls[i].y, controls[i].y + controls[i].height)) || (TERN(TOUCH_SCREEN_CALIBRATION, controls[i].type == CALIBRATE, false))) {
122+
for (uint16_t i = 0; i < controls_count; i++) {
123+
if (TERN0(TOUCH_SCREEN_CALIBRATION, controls[i].type == CALIBRATE)
124+
|| ( WITHIN(point.x, controls[i].pos.x, controls[i].pos.x + controls[i].size.x)
125+
&& WITHIN(point.y, controls[i].pos.y, controls[i].pos.y + controls[i].size.y))
126+
) {
126127
touch_control_type = controls[i].type;
127128
touch(&controls[i]);
128129
break;
@@ -133,11 +134,10 @@ void Touch::idle() {
133134
if (!current_control)
134135
touch_time = now;
135136
}
136-
x = _x;
137-
y = _y;
137+
point = got_point;
138138
}
139139
else {
140-
x = y = 0;
140+
point.reset();
141141
current_control = nullptr;
142142
touch_time = 0;
143143
touch_control_type = NONE;
@@ -150,7 +150,7 @@ void Touch::touch(touch_control_t *control) {
150150
switch (control->type) {
151151
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
152152
case CALIBRATE:
153-
if (touch_calibration.handleTouch(x, y)) ui.refresh();
153+
if (touch_calibration.handleTouch(point)) ui.refresh();
154154
break;
155155
#endif
156156

@@ -177,7 +177,7 @@ void Touch::touch(touch_control_t *control) {
177177
ui.encoderPosition = ui.encoderPosition + LCD_HEIGHT < (uint32_t)screen_items ? ui.encoderPosition + LCD_HEIGHT : screen_items;
178178
ui.refresh();
179179
break;
180-
case SLIDER: hold(control); ui.encoderPosition = (x - control->x) * control->data / control->width; break;
180+
case SLIDER: hold(control); ui.encoderPosition = (point.x - control->pos.x) * control->data / control->size.x; break;
181181
case INCREASE: hold(control, repeat_delay - 5); TERN(AUTO_BED_LEVELING_UBL, ui.external_control ? bedlevel.encoder_diff++ : ui.encoderPosition++, ui.encoderPosition++); break;
182182
case DECREASE: hold(control, repeat_delay - 5); TERN(AUTO_BED_LEVELING_UBL, ui.external_control ? bedlevel.encoder_diff-- : ui.encoderPosition--, ui.encoderPosition--); break;
183183
case HEATER:
@@ -263,28 +263,26 @@ void Touch::hold(touch_control_t *control, millis_t delay) {
263263
ui.refresh();
264264
}
265265

266-
bool Touch::get_point(int16_t *x, int16_t *y) {
267-
#if ENABLED(TFT_TOUCH_DEVICE_XPT2046)
268-
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
269-
const bool is_touched = (touch_calibration.calibration.orientation == TOUCH_PORTRAIT ? io.getRawPoint(y, x) : io.getRawPoint(x, y));
270-
if (is_touched && touch_calibration.calibration.orientation != TOUCH_ORIENTATION_NONE) {
271-
*x = int16_t((int32_t(*x) * touch_calibration.calibration.x) >> 16) + touch_calibration.calibration.offset_x;
272-
*y = int16_t((int32_t(*y) * touch_calibration.calibration.y) >> 16) + touch_calibration.calibration.offset_y;
273-
}
274-
#else
275-
const bool is_touched = (TOUCH_ORIENTATION == TOUCH_PORTRAIT ? io.getRawPoint(y, x) : io.getRawPoint(x, y));
276-
*x = uint16_t((uint32_t(*x) * TOUCH_CALIBRATION_X) >> 16) + TOUCH_OFFSET_X;
277-
*y = uint16_t((uint32_t(*y) * TOUCH_CALIBRATION_Y) >> 16) + TOUCH_OFFSET_Y;
266+
bool Touch::get_point(xy_int_t &point) {
267+
bool is_touched = false;
268+
#if ANY(TFT_TOUCH_DEVICE_XPT2046, TFT_TOUCH_DEVICE_GT911)
269+
is_touched = (TOUCH_ORIENTATION_NONE != _TOUCH_ORIENTATION)
270+
&& (TOUCH_PORTRAIT == _TOUCH_ORIENTATION
271+
? io.getRawPoint(&point.y, &point.x)
272+
: io.getRawPoint(&point.x, &point.y));
273+
#if ENABLED(TFT_TOUCH_DEVICE_XPT2046)
274+
point.x = uint16_t((uint32_t(point.x) * _TOUCH_CALIBRATION_X) >> 16) + _TOUCH_OFFSET_X;
275+
point.y = uint16_t((uint32_t(point.y) * _TOUCH_CALIBRATION_Y) >> 16) + _TOUCH_OFFSET_Y;
278276
#endif
279-
#elif ENABLED(TFT_TOUCH_DEVICE_GT911)
280-
const bool is_touched = (TOUCH_ORIENTATION == TOUCH_PORTRAIT ? io.getPoint(y, x) : io.getPoint(x, y));
281277
#endif
278+
282279
#if HAS_TOUCH_SLEEP
283280
if (is_touched)
284281
wakeUp();
285282
else if (!isSleeping() && ELAPSED(millis(), next_sleep_ms) && ui.on_status_screen())
286283
sleepTimeout();
287284
#endif
285+
288286
return is_touched;
289287
}
290288

0 commit comments

Comments
 (0)