cleanup
parent
800869979f
commit
ccf7fc3068
|
@ -189,7 +189,7 @@ void tsInit(const TouchscreenDriver *ts) {
|
||||||
coord_t tsReadX(void) {
|
coord_t tsReadX(void) {
|
||||||
coord_t x, y;
|
coord_t x, y;
|
||||||
|
|
||||||
#if TOUCHSCREEN_XY_INVERTED == TRUE
|
#if TOUCHSCREEN_XY_INVERTED
|
||||||
x = _tsReadRealY();
|
x = _tsReadRealY();
|
||||||
y = _tsReadRealX();
|
y = _tsReadRealX();
|
||||||
#else
|
#else
|
||||||
|
@ -223,7 +223,7 @@ coord_t tsReadX(void) {
|
||||||
coord_t tsReadY(void) {
|
coord_t tsReadY(void) {
|
||||||
coord_t x, y;
|
coord_t x, y;
|
||||||
|
|
||||||
#if TOUCHSCREEN_XY_INVERTED == TRUE
|
#if TOUCHSCREEN_XY_INVERTED
|
||||||
x = _tsReadRealY();
|
x = _tsReadRealY();
|
||||||
y = _tsReadRealX();
|
y = _tsReadRealX();
|
||||||
#else
|
#else
|
||||||
|
@ -320,19 +320,18 @@ calibrate:
|
||||||
/* Take a little more samples per point and their average
|
/* Take a little more samples per point and their average
|
||||||
* for precise calibration */
|
* for precise calibration */
|
||||||
px = py = 0;
|
px = py = 0;
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
while(j < MAX_CAL_SAMPLES) {
|
|
||||||
if(tsPressed()) {
|
|
||||||
/* We have valid pointer data */
|
|
||||||
|
|
||||||
#if TOUCHSCREEN_XY_INVERTED == TRUE
|
while(j < MAX_CAL_SAMPLES) {
|
||||||
|
if(tsPressed()) { /* We have valid pointer data */
|
||||||
|
#if TOUCHSCREEN_XY_INVERTED
|
||||||
py += _tsReadRealX();
|
py += _tsReadRealX();
|
||||||
px += _tsReadRealY();
|
px += _tsReadRealY();
|
||||||
#else
|
#else
|
||||||
px += _tsReadRealX();
|
px += _tsReadRealX();
|
||||||
py += _tsReadRealY();
|
py += _tsReadRealY();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue