fix(disp): change all disp_buf to draw_buf

follow up the commit:
commit e9cc1c2d46
Author: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
Date:   Wed Mar 10 13:07:15 2021 +0100

    feat(driver): raname lv_disp_buf_t to lv_disp_draw_buf_t + save only the drv's pointer in lv_disp_t
This commit is contained in:
Xiang Xiao
2021-03-14 00:45:40 +08:00
parent 1da95cf534
commit 1f3ae7f274
10 changed files with 70 additions and 70 deletions

View File

@@ -11,7 +11,7 @@ TFT_eSPI tft = TFT_eSPI(); /* TFT instance */
static uint32_t screenWidth = 320;
static uint32_t screenHeight = 240;
static lv_disp_buf_t disp_buf;
static lv_draw_buf_t draw_buf;
static lv_color_t buf[screenWidth * 10];
#if LV_USE_LOG != 0
@@ -82,7 +82,7 @@ void setup()
uint16_t calData[5] = {275, 3620, 264, 3532, 1};
tft.setTouch(calData);
lv_disp_buf_init(&disp_buf, buf, NULL, screenWidth * 10);
lv_draw_buf_init(&draw_buf, buf, NULL, screenWidth * 10);
/* Initialize the display */
lv_disp_drv_t disp_drv;
@@ -91,7 +91,7 @@ void setup()
disp_drv.hor_res = screenWidth;
disp_drv.ver_res = screenHeight;
disp_drv.flush_cb = my_disp_flush;
disp_drv.buffer = &disp_buf;
disp_drv.draw_buf = &draw_buf;
lv_disp_drv_register(&disp_drv);
/* Initialize the (dummy) input device driver */

View File

@@ -75,21 +75,21 @@ void lv_port_disp_init(void)
* */
/* Example for 1) */
static lv_disp_buf_t draw_buf_dsc_1;
static lv_color_t draw_buf_1[MY_DISP_HOR_RES * 10]; /*A buffer for 10 rows*/
lv_disp_buf_init(&draw_buf_dsc_1, draw_buf_1, NULL, MY_DISP_HOR_RES * 10); /*Initialize the display buffer*/
static lv_draw_buf_t draw_buf_dsc_1;
static lv_color_t buf_1[MY_DISP_HOR_RES * 10]; /*A buffer for 10 rows*/
lv_draw_buf_init(&draw_buf_dsc_1, buf_1, NULL, MY_DISP_HOR_RES * 10); /*Initialize the display buffer*/
/* Example for 2) */
static lv_disp_buf_t draw_buf_dsc_2;
static lv_color_t draw_buf_2_1[MY_DISP_HOR_RES * 10]; /*A buffer for 10 rows*/
static lv_color_t draw_buf_2_1[MY_DISP_HOR_RES * 10]; /*An other buffer for 10 rows*/
lv_disp_buf_init(&draw_buf_dsc_2, draw_buf_2_1, draw_buf_2_1, MY_DISP_HOR_RES * 10); /*Initialize the display buffer*/
static lv_draw_buf_t draw_buf_dsc_2;
static lv_color_t buf_2_1[MY_DISP_HOR_RES * 10]; /*A buffer for 10 rows*/
static lv_color_t buf_2_1[MY_DISP_HOR_RES * 10]; /*An other buffer for 10 rows*/
lv_draw_buf_init(&draw_buf_dsc_2, buf_2_1, buf_2_1, MY_DISP_HOR_RES * 10); /*Initialize the display buffer*/
/* Example for 3) */
static lv_disp_buf_t draw_buf_dsc_3;
static lv_color_t draw_buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES]; /*A screen sized buffer*/
static lv_color_t draw_buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES]; /*An other screen sized buffer*/
lv_disp_buf_init(&draw_buf_dsc_3, draw_buf_3_1, draw_buf_3_2, MY_DISP_VER_RES * LV_VER_RES_MAX); /*Initialize the display buffer*/
static lv_draw_buf_t draw_buf_dsc_3;
static lv_color_t buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES]; /*A screen sized buffer*/
static lv_color_t buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES]; /*An other screen sized buffer*/
lv_draw_buf_init(&draw_buf_dsc_3, buf_3_1, buf_3_2, MY_DISP_VER_RES * LV_VER_RES_MAX); /*Initialize the display buffer*/
/*-----------------------------------
* Register the display in LVGL
@@ -108,7 +108,7 @@ void lv_port_disp_init(void)
disp_drv.flush_cb = disp_flush;
/*Set a display buffer*/
disp_drv.buffer = &draw_buf_dsc_1;
disp_drv.draw_buf = &draw_buf_dsc_1;
#if LV_USE_GPU
/*Fill a memory array with a color*/