Align touch and draw in one 320x240 space like CYD LVGL9.

Drop LVGL ROTATION_270 double-transform; SoftSPI rot3 maps directly to screen pixels.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-17 18:14:26 +08:00
parent 3768e545c0
commit 1381c221d9
7 changed files with 72 additions and 45 deletions

View File

@@ -45,10 +45,10 @@ void setup() {
lv_init();
// 官方 CYD LVGL9:直接 320x240,不用 LV_DISPLAY_ROTATION_*(避免触控二次变换错位)
// https://github.com/witnessmenow/ESP32-Cheap-Yellow-Display/tree/main/Examples/LVGL9
lv_display_t *disp =
lv_tft_espi_create(SCREEN_WIDTH, SCREEN_HEIGHT, draw_buf, sizeof(draw_buf));
// 与 temperature 相同:TFT rot3 + LVGL 270;触点先算 UI 坐标再反变换喂给 LVGL
lv_display_set_rotation(disp, LV_DISPLAY_ROTATION_270);
lv_indev_t *indev = lv_indev_create();
lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER);