aboutsummaryrefslogtreecommitdiffstats
path: root/src/touchpad.c
diff options
context:
space:
mode:
authorKumar Abhishek <abhishek.kakkar@hotmail.com>2012-08-16 15:26:03 +0530
committerKumar Abhishek <abhishek.kakkar@hotmail.com>2012-08-16 15:26:03 +0530
commita41a5911e54a2b9683d88d35c01c58d0349cd804 (patch)
tree828ae9b65245bf6c4682e818d09023eba315ef3e /src/touchpad.c
parenta9beec902da2348e858dcd54550d99a40c1fbe87 (diff)
downloaduGFX-a41a5911e54a2b9683d88d35c01c58d0349cd804.tar.gz
uGFX-a41a5911e54a2b9683d88d35c01c58d0349cd804.tar.bz2
uGFX-a41a5911e54a2b9683d88d35c01c58d0349cd804.zip
Fix compiler warnings
Removed redundant dummy read from high level functions
Diffstat (limited to 'src/touchpad.c')
-rw-r--r--src/touchpad.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/touchpad.c b/src/touchpad.c
index 977bb31c..a18930da 100644
--- a/src/touchpad.c
+++ b/src/touchpad.c
@@ -69,13 +69,13 @@ static uint16_t _tpReadRealX(void) {
uint32_t results = 0;
uint16_t i, x;
+ /* Median filtering is already done in LLD */
for(i = 0; i < CONVERSIONS; i++) {
- tp_lld_read_x(); /* dummy, reduce noise on SPI */
results += tp_lld_read_x();
- }
+ }
- // 12-bit
- x = (((SCREEN_WIDTH-1) * (results/CONVERSIONS)) / 2048);
+ /* Take the average of the readings */
+ x = results / CONVERSIONS;
return x;
}
@@ -89,13 +89,13 @@ static uint16_t _tpReadRealY(void) {
uint32_t results = 0;
uint16_t i, y;
+ /* Median filtering is already done in LLD */
for(i = 0; i < CONVERSIONS; i++) {
- tp_lld_read_y(); /* dummy, reduce noise on SPI */
results += tp_lld_read_y();
- }
+ }
- // 12-bit
- y = (((SCREEN_HEIGHT-1) * (results/CONVERSIONS)) / 2048);
+ /* Take the average of the readings */
+ y = results / CONVERSIONS;
return y;
}
@@ -135,7 +135,7 @@ static void _tpDrawCross(uint16_t x, uint16_t y) {
*
* @api
*/
-void tpInit(TOUCHPADDriver *tp) {
+void tpInit(const TOUCHPADDriver *tp) {
/* Initialise Mutex */
//MUTEX_INIT