diff options
author | Andrew Hannam <andrewh@inmarket.com.au> | 2012-11-11 19:03:30 +1000 |
---|---|---|
committer | Andrew Hannam <andrewh@inmarket.com.au> | 2012-11-11 19:03:30 +1000 |
commit | 8b51bcf46f97d7cd752f3b3d9b52b9f39051f60f (patch) | |
tree | a1058cc5b7a3331b57e0bf57fe171d44dca5ff48 /src/touchscreen.c | |
parent | e28a4dbd0e5306f40f2e778025fd0e4888d9d0ba (diff) | |
download | uGFX-8b51bcf46f97d7cd752f3b3d9b52b9f39051f60f.tar.gz uGFX-8b51bcf46f97d7cd752f3b3d9b52b9f39051f60f.tar.bz2 uGFX-8b51bcf46f97d7cd752f3b3d9b52b9f39051f60f.zip |
Touch Fixes. Deprecate Console
Touch:
- Move defines that may be altered by the touch config file to the lld
header file.
- Move the definition of the Touch driver structure to the lld config
file.
- Changed CONVERSIONS macro to TOUCHSCREEN_CONVERSIONS
- Replaced references to GDISP_SCREEN_WIDTH with gdispGetWidth
- Renamed TOUCHSCREEN_HAS_IRQ to TOUCHSCREEN_HAS_PRESSED to match new
function name.
- Added prototypes for calibration storage functions to
touchscreen_lld.h so that either the lld driver or the application can
define the function.
Console:
-Deprecated into "old" directory. Functionality replaced by gwin.
Diffstat (limited to 'src/touchscreen.c')
-rw-r--r-- | src/touchscreen.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/touchscreen.c b/src/touchscreen.c index 4e90f3e4..fe51db5c 100644 --- a/src/touchscreen.c +++ b/src/touchscreen.c @@ -32,11 +32,6 @@ #if GFX_USE_TOUCHSCREEN || defined(__DOXYGEN__)
-#if TOUCHSCREEN_STORE_CALIBRATION
-extern void ts_store_calibration_lld(struct cal_t *cal);
-extern struct cal_t *ts_restore_calibration_lld(void);
-#endif
-
/*===========================================================================*/
/* Driver local definitions. */
/*===========================================================================*/
@@ -59,12 +54,12 @@ static coord_t _tsReadRealX(void) { int16_t i;
coord_t x;
- for(i = 0; i < CONVERSIONS; i++) {
+ for(i = 0; i < TOUCHSCREEN_CONVERSIONS; i++) {
results += ts_lld_read_x();
}
/* Take the average of the readings */
- x = results / CONVERSIONS;
+ x = results / TOUCHSCREEN_CONVERSIONS;
return x;
}
@@ -74,12 +69,12 @@ static coord_t _tsReadRealY(void) { int16_t i;
coord_t y;
- for(i = 0; i < CONVERSIONS; i++) {
+ for(i = 0; i < TOUCHSCREEN_CONVERSIONS; i++) {
results += ts_lld_read_y();
}
/* Take the average of the readings */
- y = results / CONVERSIONS;
+ y = results / TOUCHSCREEN_CONVERSIONS;
return y;
}
@@ -237,9 +232,9 @@ coord_t tsReadY(void) { case GDISP_ROTATE_0:
return y;
case GDISP_ROTATE_90:
- return GDISP_SCREEN_WIDTH - x - 1;
+ return gdispGetWidth() - x - 1;
case GDISP_ROTATE_180:
- return GDISP_SCREEN_HEIGHT - y - 1;
+ return gdispGetHeight() - y - 1;
case GDISP_ROTATE_270:
return x;
}
@@ -268,7 +263,7 @@ coord_t tsReadY(void) { *
* @api
*/
-#if TOUCHSCREEN_HAS_IRQ || defined(__DOXYGEN__)
+#if TOUCHSCREEN_HAS_PRESSED || defined(__DOXYGEN__)
bool_t tsPressed(void) {
return ts_lld_pressed();
}
|