Skip to content

Commit

Permalink
Fixes for display gap ESP32_1732S019
Browse files Browse the repository at this point in the history
  • Loading branch information
rzeldent committed Dec 6, 2023
1 parent 2c79759 commit 4d2f762
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/esp32_smartdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#define PANEL_SWAP_XY false
#define PANEL_MIRROR_X false
#define PANEL_MIRROR_Y false
#define PANEL_GAP_X 35
#define PANEL_GAP_Y 0
#ifdef ESP32_1732S019C
#define USES_GT911
#include "esp_lcd_touch_gt911.h"
Expand Down
12 changes: 12 additions & 0 deletions src/esp32_smartdisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ static void lvgl_update_callback(lv_disp_drv_t *drv)
case LV_DISP_ROT_NONE:
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, PANEL_SWAP_XY));
ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, PANEL_MIRROR_X, PANEL_MIRROR_Y));
#if defined(PANEL_GAP_X) || defined(PANEL_GAP_Y)
ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, PANEL_GAP_X, PANEL_GAP_Y));
#endif
#ifdef USES_TOUCH
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_x(touch_handle, TOUCH_ROT_SWAP_X));
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_y(touch_handle, TOUCH_ROT_SWAP_Y));
Expand All @@ -38,6 +41,9 @@ static void lvgl_update_callback(lv_disp_drv_t *drv)
case LV_DISP_ROT_90:
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, !PANEL_SWAP_XY));
ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, !PANEL_MIRROR_X, PANEL_MIRROR_Y));
#if defined(PANEL_GAP_X) || defined(PANEL_GAP_Y)
ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, PANEL_GAP_Y, PANEL_GAP_X));
#endif
#ifdef USES_TOUCH
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_x(touch_handle, !TOUCH_ROT_SWAP_X));
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_y(touch_handle, !TOUCH_ROT_SWAP_Y));
Expand All @@ -46,6 +52,9 @@ static void lvgl_update_callback(lv_disp_drv_t *drv)
case LV_DISP_ROT_180:
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, PANEL_SWAP_XY));
ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, !PANEL_MIRROR_X, !PANEL_MIRROR_Y));
#if defined(PANEL_GAP_X) || defined(PANEL_GAP_Y)
ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, PANEL_GAP_X, PANEL_GAP_Y));
#endif
#ifdef USES_TOUCH
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_x(touch_handle, TOUCH_ROT_SWAP_X));
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_y(touch_handle, TOUCH_ROT_SWAP_Y));
Expand All @@ -54,6 +63,9 @@ static void lvgl_update_callback(lv_disp_drv_t *drv)
case LV_DISP_ROT_270:
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, !PANEL_SWAP_XY));
ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, PANEL_MIRROR_X, !PANEL_MIRROR_Y));
#if defined(PANEL_GAP_X) || defined(PANEL_GAP_Y)
ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, PANEL_GAP_Y, PANEL_GAP_X));
#endif
#ifdef USES_TOUCH
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_x(touch_handle, !TOUCH_ROT_SWAP_X));
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_y(touch_handle, !TOUCH_ROT_SWAP_Y));
Expand Down

0 comments on commit 4d2f762

Please sign in to comment.