From 952b0b69e8f8de054e133c7ddca6e9bcd744feaf Mon Sep 17 00:00:00 2001 From: Tectu Date: Sun, 22 Jul 2012 22:21:19 +0200 Subject: [PATCH] touchpad fix --- drivers/touchpad/ads7843_lld.c | 6 +++--- drivers/touchpad/ads7843_lld.h | 6 +++--- drivers/touchpad/xpt2046_lld.c | 6 +++--- drivers/touchpad/xpt2046_lld.h | 6 +++--- touchpad/touchpad.c | 18 +++++------------- 5 files changed, 17 insertions(+), 25 deletions(-) diff --git a/drivers/touchpad/ads7843_lld.c b/drivers/touchpad/ads7843_lld.c index 507a2104..b097e0a5 100644 --- a/drivers/touchpad/ads7843_lld.c +++ b/drivers/touchpad/ads7843_lld.c @@ -2,7 +2,7 @@ #ifdef TOUCHPAD_USE_ADS7843 -__inline uint16_t lld_readX(void) { +__inline uint16_t lld_tpReadX(void) { uint8_t txbuf[1]; uint8_t rxbuf[2]; uint16_t x; @@ -19,7 +19,7 @@ __inline uint16_t lld_readX(void) { return x; } -__inline uint16_t lld_readY(void) { +__inline uint16_t lld_tpReadY(void) { uint8_t txbuf[1]; uint8_t rxbuf[2]; uint16_t y; @@ -36,7 +36,7 @@ __inline uint16_t lld_readY(void) { return y; } -__inline uint16_t lld_readZ(void) { +__inline uint16_t lld_tpReadZ(void) { return 0; } diff --git a/drivers/touchpad/ads7843_lld.h b/drivers/touchpad/ads7843_lld.h index 121e6288..d288c3ea 100644 --- a/drivers/touchpad/ads7843_lld.h +++ b/drivers/touchpad/ads7843_lld.h @@ -6,9 +6,9 @@ #ifdef TOUCHPAD_USE_ADS7843 -uint16_t lld_readX(void); -uint16_t lld_readY(void); -uint16_t lld_readZ(void); +uint16_t lld_tpReadX(void); +uint16_t lld_tpReadY(void); +uint16_t lld_tpReadZ(void); #endif #endif diff --git a/drivers/touchpad/xpt2046_lld.c b/drivers/touchpad/xpt2046_lld.c index 02ded390..eac9d19a 100644 --- a/drivers/touchpad/xpt2046_lld.c +++ b/drivers/touchpad/xpt2046_lld.c @@ -2,7 +2,7 @@ #ifdef TOUCHPAD_USE_XPT2046 -__inline uint16_t lld_readX(void) { +__inline uint16_t lld_tpReadX(void) { uint8_t txbuf[1]; uint8_t rxbuf[2]; uint16_t x; @@ -19,7 +19,7 @@ __inline uint16_t lld_readX(void) { return x; } -__inline uint16_t lld_readY(void) { +__inline uint16_t lld_tpReadY(void) { uint8_t txbuf[1]; uint8_t rxbuf[2]; uint16_t y; @@ -36,7 +36,7 @@ __inline uint16_t lld_readY(void) { return y; } -__inline uint16_t lld_readZ(void) { +__inline uint16_t lld_tpReadZ(void) { return 0; } diff --git a/drivers/touchpad/xpt2046_lld.h b/drivers/touchpad/xpt2046_lld.h index c3a12077..249c66ca 100644 --- a/drivers/touchpad/xpt2046_lld.h +++ b/drivers/touchpad/xpt2046_lld.h @@ -6,9 +6,9 @@ #ifdef TOUCHPAD_USE_XPT2046 -uint16_t lld_readX(void); -uint16_t lld_readY(void); -uint16_t lld_readZ(void); +uint16_t lld_tpReadX(void); +uint16_t lld_tpReadY(void); +uint16_t lld_tpReadZ(void); #endif #endif diff --git a/touchpad/touchpad.c b/touchpad/touchpad.c index d44e03a1..97df206b 100644 --- a/touchpad/touchpad.c +++ b/touchpad/touchpad.c @@ -16,14 +16,6 @@ void tpInit(SPIDriver *spip) { spiStart(spip, &spicfg); } -static __inline uint16_t readX(void) { - return lld_readX(); -} - -static __inline uint16_t readY(void) { - return lld_readY(); -} - uint8_t tpIRQ(void) { return (!palReadPad(TP_IRQ_PORT, TP_IRQ)); } @@ -33,8 +25,8 @@ static uint16_t tpReadRealX(void) { uint16_t i, x; for(i=0; i