Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6f0274f

Browse files
committedMar 14, 2023
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

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎Marlin/src/lcd/tft_io/touch_calibration.cpp

+7
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)
Please sign in to comment.