From e0fa7faf411c2a8878c8dcc5768a39de51e1432b Mon Sep 17 00:00:00 2001 From: Takashi Toyoshima Date: Thu, 9 Nov 2023 19:59:49 +0900 Subject: [PATCH] Adjust default touch calibration for Core2 p->touch(t) call invokes Panel_Device::touchCalibrate and results in setting up the affine matrix to map the touch geometry into the panel one. This is not preferable as the touch geometry contains the virtual screen panel area outside the panel area. This patch changes the order to call setCalibrateAffine with dedicated parameters for Core2 to overwrite the default unexpected matrix. --- src/lgfx/v1_autodetect/LGFX_AutoDetect_ESP32_all.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lgfx/v1_autodetect/LGFX_AutoDetect_ESP32_all.hpp b/src/lgfx/v1_autodetect/LGFX_AutoDetect_ESP32_all.hpp index e92cc5b2..aae32e73 100644 --- a/src/lgfx/v1_autodetect/LGFX_AutoDetect_ESP32_all.hpp +++ b/src/lgfx/v1_autodetect/LGFX_AutoDetect_ESP32_all.hpp @@ -2202,6 +2202,7 @@ namespace lgfx result->board = board_t::board_M5Tough; p->light(new Light_M5Tough()); t = new lgfx::Touch_M5Tough(); + p->touch(t); } else { @@ -2214,10 +2215,12 @@ namespace lgfx cfg.y_min = 0; cfg.y_max = 279; t->config(cfg); + p->touch(t); + // Touch 登録時に計算される標準変換式を上書きする; + // 標準式では表示領域外の仮想ボタンの高さ分だけずれてしまう; float affine[6] = { 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f }; p->setCalibrateAffine(affine); } - p->touch(t); auto cfg = t->config(); cfg.pin_int = GPIO_NUM_39; // INT pin number cfg.pin_sda = axp_i2c_sda; // I2C SDA pin number