SSD1306: Handle theme not being mono

This commit is contained in:
C47D 2021-01-31 17:28:03 -06:00
parent d6bb341f00
commit 6b0fd1f1ac
2 changed files with 14 additions and 0 deletions

View file

@ -40,7 +40,11 @@ extern "C" {
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_ILI9341
#define DISP_BUF_SIZE (LV_HOR_RES_MAX * 64)
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_SSD1306
#if defined (CONFIG_LV_THEME_MONO)
#define DISP_BUF_SIZE (LV_HOR_RES_MAX * (LV_VER_RES_MAX / 8))
#else
#define DISP_BUF_SIZE (LV_HOR_RES_MAX * LV_VER_RES_MAX)
#endif
#elif defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_FT81X)
#define DISP_BUF_LINES 40
#define DISP_BUF_SIZE (LV_HOR_RES_MAX * DISP_BUF_LINES)

View file

@ -176,8 +176,18 @@ void ssd1306_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t
void ssd1306_rounder(lv_disp_drv_t * disp_drv, lv_area_t *area)
{
#if defined (CONFIG_LV_THEME_MONO)
area->x1 = area->x1 & ~(0x07);
area->x2 = area->x2 | 0x07;
#else
uint8_t hor_max = disp_drv->hor_res;
uint8_t ver_max = disp_drv->ver_res;
area->x1 = 0;
area->y1 = 0;
area->x2 = hor_max - 1;
area->y2 = ver_max - 1;
#endif
}
void ssd1306_sleep_in(void)