From caf346d82f1de06e70c792b78ca0a0e458b73337 Mon Sep 17 00:00:00 2001 From: sharandac Date: Mon, 3 Aug 2020 20:10:28 +0200 Subject: [PATCH] touch sensor correction issue#18 --- src/config.h | 2 +- src/hardware/touch.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/config.h b/src/config.h index 76205cf..30d1419 100644 --- a/src/config.h +++ b/src/config.h @@ -31,6 +31,6 @@ /* * firmeware version string */ - #define __FIRMWARE__ "2020080312" + #define __FIRMWARE__ "2020080313" #endif // _CONFIG_H diff --git a/src/hardware/touch.cpp b/src/hardware/touch.cpp index 5c7f513..48aee7a 100644 --- a/src/hardware/touch.cpp +++ b/src/hardware/touch.cpp @@ -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 ); }