@@ -57,18 +57,20 @@ class TouchCalibration {
5757public:
5858 static calibrationState calibration_state;
5959 static touch_calibration_point_t calibration_points[4 ];
60+ static millis_t next_touch_update_ms;
6061
6162 static bool validate_precision (int32_t a, int32_t b) { return (a > b ? (100 * b) / a : (100 * a) / b) > TOUCH_SCREEN_CALIBRATION_PRECISION; }
6263 static bool validate_precision_x (uint8_t a, uint8_t b) { return validate_precision (calibration_points[a].raw_x , calibration_points[b].raw_x ); }
6364 static bool validate_precision_y (uint8_t a, uint8_t b) { return validate_precision (calibration_points[a].raw_y , calibration_points[b].raw_y ); }
6465 static void validate_calibration ();
6566
6667 static touch_calibration_t calibration;
67- static uint8_t failed_count;
68+ static uint8_t failed_count;
6869 static void calibration_reset () { calibration = { TOUCH_CALIBRATION_X, TOUCH_CALIBRATION_Y, TOUCH_OFFSET_X, TOUCH_OFFSET_Y, TOUCH_ORIENTATION }; }
6970 static bool need_calibration () { return !calibration.offset_x && !calibration.offset_y && !calibration.x && !calibration.y ; }
7071
7172 static calibrationState calibration_start () {
73+ next_touch_update_ms = millis () + 750UL ;
7274 calibration = { 0 , 0 , 0 , 0 , TOUCH_ORIENTATION_NONE };
7375 calibration_state = CALIBRATION_TOP_LEFT;
7476 calibration_points[CALIBRATION_TOP_LEFT].x = 30 ;
@@ -89,7 +91,7 @@ class TouchCalibration {
8991 return !need_calibration ();
9092 }
9193
92- static bool handleTouch (uint16_t x, uint16_t y);
94+ static bool handleTouch (const uint16_t x, const uint16_t y);
9395};
9496
9597extern TouchCalibration touch_calibration;
0 commit comments