ugfx_release_2.6
Tectu 2012-06-01 12:48:26 +02:00
parent a7295f47e9
commit e38fc24c61
1 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ static uint16_t readX(void) {
uint8_t rxbuf[2]; uint8_t rxbuf[2];
uint16_t x; uint16_t x;
txbuf[0] = 0x90; txbuf[0] = 0xd0;
SET_CS(0); SET_CS(0);
spiSend(&SPID1, 1, txbuf); spiSend(&SPID1, 1, txbuf);
spiReceive(&SPID1, 2, rxbuf); spiReceive(&SPID1, 2, rxbuf);
@ -35,7 +35,7 @@ static uint16_t readY(void) {
uint8_t rxbuf[2]; uint8_t rxbuf[2];
uint16_t y; uint16_t y;
txbuf[0] = 0xd0; txbuf[0] = 0x90;
SET_CS(0); SET_CS(0);
spiSend(&SPID1, 1, txbuf); spiSend(&SPID1, 1, txbuf);
spiReceive(&SPID1, 2, rxbuf); spiReceive(&SPID1, 2, rxbuf);
@ -55,7 +55,7 @@ uint16_t tpReadX(void) {
results += readX(); results += readX();
} }
x = (((lcdGetWidth()-1) * (results/CONVERSIONS)) / 2048); x = (((lcdGetHeight()-1) * (results/CONVERSIONS)) / 2048);
return x; return x;
} }
@ -67,7 +67,7 @@ uint16_t tpReadY(void) {
for(i=0; i<CONVERSIONS; i++) for(i=0; i<CONVERSIONS; i++)
results += readY(); results += readY();
y = (((lcdGetHeight()-1) * (results/CONVERSIONS)) / 2048); y = (((lcdGetWidth()-1) * (results/CONVERSIONS)) / 2048);
return y; return y;
} }