cleanup
This commit is contained in:
parent
800869979f
commit
ccf7fc3068
1 changed files with 107 additions and 108 deletions
|
@ -189,7 +189,7 @@ void tsInit(const TouchscreenDriver *ts) {
|
|||
coord_t tsReadX(void) {
|
||||
coord_t x, y;
|
||||
|
||||
#if TOUCHSCREEN_XY_INVERTED == TRUE
|
||||
#if TOUCHSCREEN_XY_INVERTED
|
||||
x = _tsReadRealY();
|
||||
y = _tsReadRealX();
|
||||
#else
|
||||
|
@ -223,7 +223,7 @@ coord_t tsReadX(void) {
|
|||
coord_t tsReadY(void) {
|
||||
coord_t x, y;
|
||||
|
||||
#if TOUCHSCREEN_XY_INVERTED == TRUE
|
||||
#if TOUCHSCREEN_XY_INVERTED
|
||||
x = _tsReadRealY();
|
||||
y = _tsReadRealX();
|
||||
#else
|
||||
|
@ -320,19 +320,18 @@ calibrate:
|
|||
/* Take a little more samples per point and their average
|
||||
* for precise calibration */
|
||||
px = py = 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();
|
||||
px += _tsReadRealY();
|
||||
#else
|
||||
px += _tsReadRealX();
|
||||
py += _tsReadRealY();
|
||||
#endif
|
||||
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue