Fixing STMPE811 driver

ugfx_release_2.6
Joel Bodenmann 2014-10-13 23:01:01 +02:00
parent 7c9e3e5a42
commit d6b4af4ff6
1 changed files with 5 additions and 5 deletions

View File

@ -14,12 +14,12 @@
#define GMOUSE_STMPE811_FLG_TOUCHED (GMOUSE_FLG_DRIVER_FIRST<<0)
// Get the hardware interface
#include "gmouse_lld_STMPE811_board.h"
// Hardware definitions
#include "drivers/ginput/touch/STMPE811/stmpe811.h"
// Get the hardware interface
#include "gmouse_lld_STMPE811_board.h"
static bool_t MouseInit(GMouse* m, unsigned driverinstance) {
if (!init_board(m, driverinstance))
return FALSE;
@ -61,7 +61,7 @@ static bool_t MouseInit(GMouse* m, unsigned driverinstance) {
return TRUE;
}
static void MouseXYZ(GMouse* m, GMouseReading* pdr)
static void read_xyz(GMouse* m, GMouseReading* pdr)
{
bool_t clearfifo; // Do we need to clear the FIFO
@ -76,7 +76,7 @@ static void MouseXYZ(GMouse* m, GMouseReading* pdr)
clearfifo = false;
if(getpin_irq(m)) {
write_reg(m, STMPE811_REG_INT_STA, 0xFF); // clear all interrupts
if (read_byte(STMPE811_REG_TSC_CTRL) & 0x80) // set the new touched status
if (read_byte(m, STMPE811_REG_TSC_CTRL) & 0x80) // set the new touched status
m->flags |= GMOUSE_STMPE811_FLG_TOUCHED;
else
m->flags &= ~GMOUSE_STMPE811_FLG_TOUCHED;