add examples + refactoring
This commit is contained in:
@@ -76,20 +76,20 @@ 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[LV_HOR_RES_MAX * 10]; /*A buffer for 10 rows*/
|
||||
lv_disp_buf_init(&draw_buf_dsc_1, draw_buf_1, NULL, LV_HOR_RES_MAX * 10); /*Initialize the display buffer*/
|
||||
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*/
|
||||
|
||||
/* Example for 2) */
|
||||
static lv_disp_buf_t draw_buf_dsc_2;
|
||||
static lv_color_t draw_buf_2_1[LV_HOR_RES_MAX * 10]; /*A buffer for 10 rows*/
|
||||
static lv_color_t draw_buf_2_1[LV_HOR_RES_MAX * 10]; /*An other buffer for 10 rows*/
|
||||
lv_disp_buf_init(&draw_buf_dsc_2, draw_buf_2_1, draw_buf_2_1, LV_HOR_RES_MAX * 10); /*Initialize the display buffer*/
|
||||
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*/
|
||||
|
||||
/* Example for 3) */
|
||||
static lv_disp_buf_t draw_buf_dsc_3;
|
||||
static lv_color_t draw_buf_3_1[LV_HOR_RES_MAX * LV_VER_RES_MAX]; /*A screen sized buffer*/
|
||||
static lv_color_t draw_buf_3_1[LV_HOR_RES_MAX * LV_VER_RES_MAX]; /*An other screen sized buffer*/
|
||||
lv_disp_buf_init(&draw_buf_dsc_3, draw_buf_3_1, draw_buf_3_2, LV_HOR_RES_MAX * LV_VER_RES_MAX); /*Initialize the display buffer*/
|
||||
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*/
|
||||
|
||||
/*-----------------------------------
|
||||
* Register the display in LVGL
|
||||
|
||||
Reference in New Issue
Block a user