Skip to content

Commit

Permalink
Adjust default touch calibration for Core2
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
toyoshim committed Nov 9, 2023
1 parent 302169a commit e0fa7fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lgfx/v1_autodetect/LGFX_AutoDetect_ESP32_all.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
Expand Down

0 comments on commit e0fa7fa

Please sign in to comment.