diff --git a/lvgl_tft/st7735s.h b/lvgl_tft/st7735s.h index 2d02ed0..78e1d38 100644 --- a/lvgl_tft/st7735s.h +++ b/lvgl_tft/st7735s.h @@ -37,8 +37,19 @@ extern "C" { // https://github.com/adafruit/Adafruit-ST7735-Library // #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 / 1 offset) + +// TODO: this should be config option +#if CONFIG_LV_HOR_RES_MAX==128 && CONFIG_LV_VER_RES_MAX==128 +#define COLSTART 2 +#define ROWSTART 1 +#elif CONFIG_LV_HOR_RES_MAX==128 && CONFIG_LV_VER_RES_MAX==80 #define COLSTART 26 #define ROWSTART 1 +#else +#define COLSTART 0 +#define ROWSTART 0 +#endif + // Delay between some initialisation commands #define TFT_INIT_DELAY 0x80