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 by pressing & holding touch screen.
  • Loading branch information
thisiskeithb committed Jan 27, 2023
1 parent 67bc855 commit b144fe4
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 by pressing & holding touch screen
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 b144fe4

Please sign in to comment.