diff options
| author | guo <[email protected]> | 2022-01-06 19:59:03 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-06 19:59:03 +0800 |
| commit | 495e209f379338b2bbc4ba086e457d0fb6d22a8d (patch) | |
| tree | 2654bdb129295f0cf7d021548ea39d9a9f9f067b | |
| parent | 7566c1a24c38141abdebb9026d2d76b11f0463de (diff) | |
| parent | 195f753cbbad47d56f72719ab6849d72371df67a (diff) | |
Merge pull request #5480 from mysterywolf/l475
[lvgl][l475] use single buffer instead of double buffers
| -rw-r--r-- | bsp/stm32/stm32l475-atk-pandora/applications/lvgl/lv_port_disp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bsp/stm32/stm32l475-atk-pandora/applications/lvgl/lv_port_disp.c b/bsp/stm32/stm32l475-atk-pandora/applications/lvgl/lv_port_disp.c index f159d42b7a..f72e434978 100644 --- a/bsp/stm32/stm32l475-atk-pandora/applications/lvgl/lv_port_disp.c +++ b/bsp/stm32/stm32l475-atk-pandora/applications/lvgl/lv_port_disp.c @@ -10,8 +10,8 @@ #include <lvgl.h> #include <drv_lcd.h> -#define MY_DISP_HOR_RES LCD_W -#define DISP_BUFFER_LINES 70 +#define MY_DISP_HOR_RES LCD_W +#define DISP_BUFFER_LINES (LCD_H/5) /*A static or global variable to store the buffers*/ static lv_disp_draw_buf_t disp_buf; @@ -21,7 +21,6 @@ static lv_disp_drv_t disp_drv; /*Static or global buffer(s). The second buffer is optional*/ static lv_color_t buf_1[MY_DISP_HOR_RES * DISP_BUFFER_LINES]; -static lv_color_t buf_2[MY_DISP_HOR_RES * DISP_BUFFER_LINES]; /*Flush the content of the internal buffer the specific area on the display *You can use DMA or any hardware acceleration to do this operation in the background but @@ -39,7 +38,7 @@ static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_colo void lv_port_disp_init(void) { /*Initialize `disp_buf` with the buffer(s). With only one buffer use NULL instead buf_2 */ - lv_disp_draw_buf_init(&disp_buf, buf_1, buf_2, MY_DISP_HOR_RES * DISP_BUFFER_LINES); + lv_disp_draw_buf_init(&disp_buf, buf_1, RT_NULL, MY_DISP_HOR_RES * DISP_BUFFER_LINES); lv_disp_drv_init(&disp_drv); /*Basic initialization*/ |
