Fix compiler warnings
Removed redundant dummy read from high level functions
This commit is contained in:
parent
a9beec902d
commit
a41a5911e5
2 changed files with 10 additions and 10 deletions
|
@ -70,7 +70,7 @@ struct cal {
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void tpInit(TOUCHPADDriver *tp);
|
void tpInit(const TOUCHPADDriver *tp);
|
||||||
uint16_t tpReadX(void);
|
uint16_t tpReadX(void);
|
||||||
uint16_t tpReadY(void);
|
uint16_t tpReadY(void);
|
||||||
|
|
||||||
|
|
|
@ -69,13 +69,13 @@ static uint16_t _tpReadRealX(void) {
|
||||||
uint32_t results = 0;
|
uint32_t results = 0;
|
||||||
uint16_t i, x;
|
uint16_t i, x;
|
||||||
|
|
||||||
|
/* Median filtering is already done in LLD */
|
||||||
for(i = 0; i < CONVERSIONS; i++) {
|
for(i = 0; i < CONVERSIONS; i++) {
|
||||||
tp_lld_read_x(); /* dummy, reduce noise on SPI */
|
|
||||||
results += tp_lld_read_x();
|
results += tp_lld_read_x();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 12-bit
|
/* Take the average of the readings */
|
||||||
x = (((SCREEN_WIDTH-1) * (results/CONVERSIONS)) / 2048);
|
x = results / CONVERSIONS;
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
@ -89,13 +89,13 @@ static uint16_t _tpReadRealY(void) {
|
||||||
uint32_t results = 0;
|
uint32_t results = 0;
|
||||||
uint16_t i, y;
|
uint16_t i, y;
|
||||||
|
|
||||||
|
/* Median filtering is already done in LLD */
|
||||||
for(i = 0; i < CONVERSIONS; i++) {
|
for(i = 0; i < CONVERSIONS; i++) {
|
||||||
tp_lld_read_y(); /* dummy, reduce noise on SPI */
|
|
||||||
results += tp_lld_read_y();
|
results += tp_lld_read_y();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 12-bit
|
/* Take the average of the readings */
|
||||||
y = (((SCREEN_HEIGHT-1) * (results/CONVERSIONS)) / 2048);
|
y = results / CONVERSIONS;
|
||||||
|
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ static void _tpDrawCross(uint16_t x, uint16_t y) {
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
void tpInit(TOUCHPADDriver *tp) {
|
void tpInit(const TOUCHPADDriver *tp) {
|
||||||
/* Initialise Mutex */
|
/* Initialise Mutex */
|
||||||
//MUTEX_INIT
|
//MUTEX_INIT
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue