add lovyangfx custom offset for tft

This commit is contained in:
marsman7 2024-12-07 22:21:27 +01:00
parent 9a3e9c03b8
commit 7ced77a7a9
2 changed files with 8 additions and 2 deletions

View File

@ -113,6 +113,12 @@
#ifndef SPI_READ_FREQUENCY #ifndef SPI_READ_FREQUENCY
#define SPI_READ_FREQUENCY 0 #define SPI_READ_FREQUENCY 0
#endif #endif
#ifndef TFT_OFFSET_X
#define TFT_OFFSET_X 0
#endif
#ifndef TFT_OFFSET_Y
#define TFT_OFFSET_Y 0
#endif
#ifndef TFT_OFFSET_ROTATION #ifndef TFT_OFFSET_ROTATION
#define TFT_OFFSET_ROTATION 0 #define TFT_OFFSET_ROTATION 0
#endif #endif

View File

@ -204,8 +204,8 @@ static void configure_panel(lgfx::Panel_Device* panel, Preferences* prefs)
cfg.memory_width = prefs->getUInt("memory_width", cfg.panel_width); // Maximum width supported by driver IC cfg.memory_width = prefs->getUInt("memory_width", cfg.panel_width); // Maximum width supported by driver IC
cfg.memory_height = prefs->getUInt("memory_height", cfg.panel_height); // Maximum height supported by driver IC cfg.memory_height = prefs->getUInt("memory_height", cfg.panel_height); // Maximum height supported by driver IC
cfg.offset_x = prefs->getUInt("offset_x", 0); // Amount of offset in the X direction of the panel cfg.offset_x = prefs->getUInt("offset_x", TFT_OFFSET_X); // Amount of offset in the X direction of the panel
cfg.offset_y = prefs->getUInt("offset_y", 0); // Amount of offset in the Y direction of the panel cfg.offset_y = prefs->getUInt("offset_y", TFT_OFFSET_Y); // Amount of offset in the Y direction of the panel
cfg.offset_rotation = cfg.offset_rotation =
prefs->getUInt("offset_rotation", TFT_OFFSET_ROTATION); // Offset of the rotation 0 ~ 7 (4 ~ 7 is upside down) prefs->getUInt("offset_rotation", TFT_OFFSET_ROTATION); // Offset of the rotation 0 ~ 7 (4 ~ 7 is upside down)