@@ -57,18 +57,20 @@ class TouchCalibration {
57
57
public:
58
58
static calibrationState calibration_state;
59
59
static touch_calibration_point_t calibration_points[4 ];
60
+ static millis_t next_touch_update_ms;
60
61
61
62
static bool validate_precision (int32_t a, int32_t b) { return (a > b ? (100 * b) / a : (100 * a) / b) > TOUCH_SCREEN_CALIBRATION_PRECISION; }
62
63
static bool validate_precision_x (uint8_t a, uint8_t b) { return validate_precision (calibration_points[a].raw_x , calibration_points[b].raw_x ); }
63
64
static bool validate_precision_y (uint8_t a, uint8_t b) { return validate_precision (calibration_points[a].raw_y , calibration_points[b].raw_y ); }
64
65
static void validate_calibration ();
65
66
66
67
static touch_calibration_t calibration;
67
- static uint8_t failed_count;
68
+ static uint8_t failed_count;
68
69
static void calibration_reset () { calibration = { TOUCH_CALIBRATION_X, TOUCH_CALIBRATION_Y, TOUCH_OFFSET_X, TOUCH_OFFSET_Y, TOUCH_ORIENTATION }; }
69
70
static bool need_calibration () { return !calibration.offset_x && !calibration.offset_y && !calibration.x && !calibration.y ; }
70
71
71
72
static calibrationState calibration_start () {
73
+ next_touch_update_ms = millis () + 750UL ;
72
74
calibration = { 0 , 0 , 0 , 0 , TOUCH_ORIENTATION_NONE };
73
75
calibration_state = CALIBRATION_TOP_LEFT;
74
76
calibration_points[CALIBRATION_TOP_LEFT].x = 30 ;
@@ -89,7 +91,7 @@ class TouchCalibration {
89
91
return !need_calibration ();
90
92
}
91
93
92
- static bool handleTouch (uint16_t x, uint16_t y);
94
+ static bool handleTouch (const uint16_t x, const uint16_t y);
93
95
};
94
96
95
97
extern TouchCalibration touch_calibration;
0 commit comments