From 7d339be14aa910c31a66fcdb574d40566d64e193 Mon Sep 17 00:00:00 2001 From: martinberlin Date: Sat, 29 May 2021 02:03:04 +0200 Subject: [PATCH] Attempt to add partial update when flush area is not full screen --- lvgl_helpers.h | 2 +- lvgl_tft/epdiy_epaper.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lvgl_helpers.h b/lvgl_helpers.h index 0a7a415..8699ec7 100644 --- a/lvgl_helpers.h +++ b/lvgl_helpers.h @@ -44,7 +44,7 @@ extern "C" { #define DISP_BUF_SIZE (LV_HOR_RES_MAX * 40) // Here is the issue that it does not draw full epaper. Insufficient buffer: #elif defined (CONFIG_LV_EPAPER_EPDIY_DISPLAY_CONTROLLER) -#define DISP_BUF_SIZE (LV_HOR_RES_MAX * 70) +#define DISP_BUF_SIZE (LV_HOR_RES_MAX * 90) #elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_HX8357 #define DISP_BUF_SIZE (LV_HOR_RES_MAX * 40) #elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_SH1107 diff --git a/lvgl_tft/epdiy_epaper.cpp b/lvgl_tft/epdiy_epaper.cpp index 5729a05..4ea6c89 100644 --- a/lvgl_tft/epdiy_epaper.cpp +++ b/lvgl_tft/epdiy_epaper.cpp @@ -32,9 +32,16 @@ void epdiy_init(void) void epdiy_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_map) { ++flushcalls; - printf("epdiy_flush %d\n", flushcalls); + printf("epdiy_flush %d x:%d y:%d w:%d h:%d\n", flushcalls,area->x1,area->y1,lv_area_get_width(area),lv_area_get_height(area)); - display.update(); + // Full update + if (lv_area_get_width(area)==display.width() && lv_area_get_height(area)==display.height()) { + display.update(); + } else { + // Partial update: Looks nice but should find a way to clear that area first. Mode: MODE_EPDIY_WHITE_TO_GL16 + display.updateWindow(area->x1,area->y1,lv_area_get_width(area),lv_area_get_height(area),MODE_GC16); + } + /* IMPORTANT!!! * Inform the graphics library that you are ready with the flushing */ lv_disp_flush_ready(drv);