ADS7843 fix
This commit is contained in:
parent
7b2e0d06d4
commit
b1b117bffa
3 changed files with 9 additions and 5 deletions
|
@ -119,7 +119,7 @@ void ginput_lld_mouse_get_reading(MouseReading *pt) {
|
||||||
sampleBuf[i] = read_value(0xD1);
|
sampleBuf[i] = read_value(0xD1);
|
||||||
read_value(0xD0);
|
read_value(0xD0);
|
||||||
filter();
|
filter();
|
||||||
lastx = 42;//(coord_t)sampleBuf[3];
|
lastx = (coord_t)sampleBuf[3];
|
||||||
|
|
||||||
/* Get the Y value using the same process as above */
|
/* Get the Y value using the same process as above */
|
||||||
read_value(0x91);
|
read_value(0x91);
|
||||||
|
@ -127,7 +127,7 @@ void ginput_lld_mouse_get_reading(MouseReading *pt) {
|
||||||
sampleBuf[i] = read_value(0x91);
|
sampleBuf[i] = read_value(0x91);
|
||||||
read_value(0x90);
|
read_value(0x90);
|
||||||
filter();
|
filter();
|
||||||
lasty = 42;//(coord_t)sampleBuf[3];
|
lasty = (coord_t)sampleBuf[3];
|
||||||
|
|
||||||
// Release the bus
|
// Release the bus
|
||||||
release_bus();
|
release_bus();
|
||||||
|
|
|
@ -61,6 +61,8 @@ static __inline bool_t getpin_pressed(void) {
|
||||||
*/
|
*/
|
||||||
static __inline void aquire_bus(void) {
|
static __inline void aquire_bus(void) {
|
||||||
spiAcquireBus(&SPID1);
|
spiAcquireBus(&SPID1);
|
||||||
|
//TOUCHSCREEN_SPI_PROLOGUE();
|
||||||
|
palClearPad(GPIOC, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,7 +71,9 @@ static __inline void aquire_bus(void) {
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static __inline void release_bus(void) {
|
||||||
|
palSetPad(GPIOC, 6);
|
||||||
spiReleaseBus(&SPID1);
|
spiReleaseBus(&SPID1);
|
||||||
|
//TOUCHSCREEN_SPI_EPILOGUE();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,8 +94,8 @@ static __inline uint16_t read_value(uint16_t port) {
|
||||||
spiExchange(&SPID1, 3, txbuf, rxbuf);
|
spiExchange(&SPID1, 3, txbuf, rxbuf);
|
||||||
|
|
||||||
ret = (rxbuf[1] << 5) | (rxbuf[2] >> 3);
|
ret = (rxbuf[1] << 5) | (rxbuf[2] >> 3);
|
||||||
return 42;
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _GINPUT_LLD_MOUSE_BOARD_H */
|
#endif /* _GINPUT_LLD_MOUSE_BOARD_H */
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#define _LLD_GINPUT_MOUSE_CONFIG_H
|
#define _LLD_GINPUT_MOUSE_CONFIG_H
|
||||||
|
|
||||||
#define GINPUT_MOUSE_EVENT_TYPE GEVENT_TOUCH
|
#define GINPUT_MOUSE_EVENT_TYPE GEVENT_TOUCH
|
||||||
#define GINPUT_MOUSE_NEED_CALIBRATION FALSE
|
#define GINPUT_MOUSE_NEED_CALIBRATION TRUE
|
||||||
#define GINPUT_MOUSE_LLD_CALIBRATION_LOADSAVE FALSE
|
#define GINPUT_MOUSE_LLD_CALIBRATION_LOADSAVE FALSE
|
||||||
#define GINPUT_MOUSE_MAX_CALIBRATION_ERROR 4
|
#define GINPUT_MOUSE_MAX_CALIBRATION_ERROR 4
|
||||||
#define GINPUT_MOUSE_READ_CYCLES 4
|
#define GINPUT_MOUSE_READ_CYCLES 4
|
||||||
|
|
Loading…
Add table
Reference in a new issue