touch sensor correction issue#18

This commit is contained in:
sharandac
2020-08-03 20:10:28 +02:00
parent 3e54607a35
commit caf346d82f
2 changed files with 8 additions and 1 deletions

View File

@@ -31,6 +31,6 @@
/*
* firmeware version string
*/
#define __FIRMWARE__ "2020080312"
#define __FIRMWARE__ "2020080313"
#endif // _CONFIG_H

View File

@@ -76,6 +76,13 @@ static bool touch_getXY( int16_t &x, int16_t &y ) {
x = p.x;
y = p.y;
}
// issue https://github.com/sharandac/My-TTGO-Watch/issues/18 fix
float temp_x = ( x - ( LV_HOR_RES_MAX / 2 ) ) * 1.15;
float temp_y = ( y - ( LV_VER_RES_MAX / 2 ) ) * 1.0;
x = temp_x + ( LV_HOR_RES_MAX / 2 );
y = temp_y + ( LV_VER_RES_MAX / 2 );
return( true );
}