commit
2ec39c7dbb
1 changed files with 21 additions and 15 deletions
|
@ -149,10 +149,13 @@ void tpInit(const TOUCHPADDriver *tp) {
|
||||||
*/
|
*/
|
||||||
uint16_t tpReadX(void) {
|
uint16_t tpReadX(void) {
|
||||||
uint16_t x, y;
|
uint16_t x, y;
|
||||||
|
#if defined(TOUCHPAD_XY_INVERTED) && (TOUCHPAD_XY_INVERTED == TRUE)
|
||||||
|
x = cal.xm * _tpReadRealY() + cal.xn;
|
||||||
|
y = cal.ym * _tpReadRealX() + cal.yn;
|
||||||
|
#else
|
||||||
x = cal.xm * _tpReadRealX() + cal.xn;
|
x = cal.xm * _tpReadRealX() + cal.xn;
|
||||||
y = cal.ym * _tpReadRealY() + cal.yn;
|
y = cal.ym * _tpReadRealY() + cal.yn;
|
||||||
|
#endif
|
||||||
switch(gdispGetOrientation()) {
|
switch(gdispGetOrientation()) {
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
return x;
|
return x;
|
||||||
|
@ -176,10 +179,13 @@ uint16_t tpReadX(void) {
|
||||||
*/
|
*/
|
||||||
uint16_t tpReadY(void) {
|
uint16_t tpReadY(void) {
|
||||||
uint16_t x, y;
|
uint16_t x, y;
|
||||||
|
#if defined(TOUCHPAD_XY_INVERTED) && (TOUCHPAD_XY_INVERTED == TRUE)
|
||||||
|
x = cal.xm * _tpReadRealY() + cal.xn;
|
||||||
|
y = cal.ym * _tpReadRealX() + cal.yn;
|
||||||
|
#else
|
||||||
x = cal.xm * _tpReadRealX() + cal.xn;
|
x = cal.xm * _tpReadRealX() + cal.xn;
|
||||||
y = cal.ym * _tpReadRealY() + cal.yn;
|
y = cal.ym * _tpReadRealY() + cal.yn;
|
||||||
|
#endif
|
||||||
switch(gdispGetOrientation()) {
|
switch(gdispGetOrientation()) {
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
return y;
|
return y;
|
||||||
|
|
Loading…
Add table
Reference in a new issue