ugfx_release_2.6
Joel Bodenmann 2012-11-10 18:39:00 +01:00
parent 800869979f
commit ccf7fc3068
1 changed files with 107 additions and 108 deletions

View File

@ -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
#else
px += _tsReadRealX();
py += _tsReadRealY();
#endif
#endif
j++;
}
}
@ -351,7 +350,7 @@ calibrate:
/* Apply 3 point calibration algorithm */
_tsDo3PointCalibration(cross, points, cal);
#if TOUCHSCREEN_VERIFY_CALIBRATION
#if TOUCHSCREEN_VERIFY_CALIBRATION
/* Verification of correctness of calibration (optional) :
* See if the 4th point (Middle of the screen) coincides with the calibrated
* result. If point is with +/- 2 pixel margin, then successful calibration
@ -367,7 +366,7 @@ calibrate:
if(px > 4)
goto calibrate;
#endif
#endif
/* If enabled, serialize the calibration values for storage */
#if TOUCHSCREEN_STORE_CALIBRATION