Skip to content

Commit

Permalink
Fix TOUCH_SCREEN_CALIBRATION Invalid First Point
Browse files Browse the repository at this point in the history
Avoid registering first touch point as top-left corner when initiating touch calibration since user is touching TFT
  • Loading branch information
thisiskeithb committed Mar 14, 2023
1 parent 3156595 commit 6f0274f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Marlin/src/lcd/tft_io/touch_calibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ void TouchCalibration::validate_calibration() {
bool TouchCalibration::handleTouch(uint16_t x, uint16_t y) {
static millis_t next_button_update_ms = 0;
const millis_t now = millis();

// Avoid registering first touch point as top-left corner when initiating touch calibration since user is touching TFT
if (next_button_update_ms == 0) {
next_button_update_ms = now + BUTTON_DELAY_MENU;
return true;
}

if (PENDING(now, next_button_update_ms)) return false;
next_button_update_ms = now + BUTTON_DELAY_MENU;

Expand Down

0 comments on commit 6f0274f

Please sign in to comment.