aboutsummaryrefslogtreecommitdiffstats
path: root/touchpad.c
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-06-04 21:04:18 +0200
committerTectu <joel@unormal.org>2012-06-04 21:04:18 +0200
commit475e990f3c6bfc4cd0e5df4b7ada6eb6fb29961c (patch)
treee89b93d46504096d24fb3b8c23ccd7e57069cae1 /touchpad.c
parent0f0f912661cf4d48703c93aa0f98e31af54a0626 (diff)
downloaduGFX-475e990f3c6bfc4cd0e5df4b7ada6eb6fb29961c.tar.gz
uGFX-475e990f3c6bfc4cd0e5df4b7ada6eb6fb29961c.tar.bz2
uGFX-475e990f3c6bfc4cd0e5df4b7ada6eb6fb29961c.zip
cleanups
Diffstat (limited to 'touchpad.c')
-rw-r--r--touchpad.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/touchpad.c b/touchpad.c
index d8d93914..6570a45c 100644
--- a/touchpad.c
+++ b/touchpad.c
@@ -2,7 +2,6 @@
#include "glcd.h"
static struct cal cal;
-static int16_t x_cal = 0, y_cal = 0;
static void spicb(SPIDriver *spip);
static const SPIConfig spicfg = {
@@ -91,27 +90,27 @@ uint16_t tpReadY(void) {
}
void tpDrawCross(uint16_t x, uint16_t y) {
- lcdDrawLine(x-15,y,x-2,y,0xffff);
- lcdDrawLine(x+2,y,x+15,y,0xffff);
- lcdDrawLine(x,y-15,x,y-2,0xffff);
- lcdDrawLine(x,y+2,x,y+15,0xffff);
+ lcdDrawLine(x-15, y, x-2, y, 0xffff);
+ lcdDrawLine(x+2, y, x+15, y, 0xffff);
+ lcdDrawLine(x, y-15, x, y-2, 0xffff);
+ lcdDrawLine(x, y+2, x, y+15, 0xffff);
- lcdDrawLine(x-15,y+15,x-7,y+15,RGB565CONVERT(184,158,131));
- lcdDrawLine(x-15,y+7,x-15,y+15,RGB565CONVERT(184,158,131));
+ lcdDrawLine(x-15, y+15, x-7, y+15, RGB565CONVERT(184, 158, 131));
+ lcdDrawLine(x-15, y+7, x-15, y+15, RGB565CONVERT(184, 158, 131));
- lcdDrawLine(x-15,y-15,x-7,y-15,RGB565CONVERT(184,158,131));
- lcdDrawLine(x-15,y-7,x-15,y-15,RGB565CONVERT(184,158,131));
+ lcdDrawLine(x-15, y-15, x-7, y-15, RGB565CONVERT(184, 158, 131));
+ lcdDrawLine(x-15, y-7, x-15, y-15, RGB565CONVERT(184, 158, 131));
- lcdDrawLine(x+7,y+15,x+15,y+15,RGB565CONVERT(184,158,131));
- lcdDrawLine(x+15,y+7,x+15,y+15,RGB565CONVERT(184,158,131));
+ lcdDrawLine(x+7, y+15, x+15, y+15, RGB565CONVERT(184, 158, 131));
+ lcdDrawLine(x+15, y+7, x+15, y+15, RGB565CONVERT(184, 158, 131));
- lcdDrawLine(x+7,y-15,x+15,y-15,RGB565CONVERT(184,158,131));
- lcdDrawLine(x+15,y-15,x+15,y-7,RGB565CONVERT(184,158,131));
+ lcdDrawLine(x+7, y-15, x+15, y-15, RGB565CONVERT(184, 158, 131));
+ lcdDrawLine(x+15, y-15, x+15, y-7, RGB565CONVERT(184, 158, 131));
}
void tpCalibrate(void) {
- int16_t cross[2][2] = {{40,40}, {200, 280}};
- int16_t points[2][2];
+ uint16_t cross[2][2] = {{40,40}, {200, 280}};
+ uint16_t points[2][2];
uint8_t i;
char buffer[32];