Skip to content

Commit 495e209

Browse files
authored
Merge pull request #5480 from mysterywolf/l475
[lvgl][l475] use single buffer instead of double buffers
2 parents 7566c1a + 195f753 commit 495e209

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

bsp/stm32/stm32l475-atk-pandora/applications/lvgl/lv_port_disp.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#include <lvgl.h>
1111
#include <drv_lcd.h>
1212

13-
#define MY_DISP_HOR_RES LCD_W
14-
#define DISP_BUFFER_LINES 70
13+
#define MY_DISP_HOR_RES LCD_W
14+
#define DISP_BUFFER_LINES (LCD_H/5)
1515

1616
/*A static or global variable to store the buffers*/
1717
static lv_disp_draw_buf_t disp_buf;
@@ -21,7 +21,6 @@ static lv_disp_drv_t disp_drv;
2121

2222
/*Static or global buffer(s). The second buffer is optional*/
2323
static lv_color_t buf_1[MY_DISP_HOR_RES * DISP_BUFFER_LINES];
24-
static lv_color_t buf_2[MY_DISP_HOR_RES * DISP_BUFFER_LINES];
2524

2625
/*Flush the content of the internal buffer the specific area on the display
2726
*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
3938
void lv_port_disp_init(void)
4039
{
4140
/*Initialize `disp_buf` with the buffer(s). With only one buffer use NULL instead buf_2 */
42-
lv_disp_draw_buf_init(&disp_buf, buf_1, buf_2, MY_DISP_HOR_RES * DISP_BUFFER_LINES);
41+
lv_disp_draw_buf_init(&disp_buf, buf_1, RT_NULL, MY_DISP_HOR_RES * DISP_BUFFER_LINES);
4342

4443
lv_disp_drv_init(&disp_drv); /*Basic initialization*/
4544

0 commit comments

Comments
 (0)