Skip to content

Commit 6f0274f

Browse files
committed
Fix TOUCH_SCREEN_CALIBRATION Invalid First Point
Avoid registering first touch point as top-left corner when initiating touch calibration since user is touching TFT
1 parent 3156595 commit 6f0274f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Marlin/src/lcd/tft_io/touch_calibration.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ void TouchCalibration::validate_calibration() {
9292
bool TouchCalibration::handleTouch(uint16_t x, uint16_t y) {
9393
static millis_t next_button_update_ms = 0;
9494
const millis_t now = millis();
95+
96+
// Avoid registering first touch point as top-left corner when initiating touch calibration since user is touching TFT
97+
if (next_button_update_ms == 0) {
98+
next_button_update_ms = now + BUTTON_DELAY_MENU;
99+
return true;
100+
}
101+
95102
if (PENDING(now, next_button_update_ms)) return false;
96103
next_button_update_ms = now + BUTTON_DELAY_MENU;
97104

0 commit comments

Comments
 (0)