fix(example): replace LV_HOR_RES_MAX with 320 in LVGL_Arduino.ino

since LV_HOR_RES_MAX doesn't exist anymore
This commit is contained in:
Xiang Xiao 2021-03-12 15:46:23 +08:00
parent 460b227b83
commit 1da95cf534

View File

@ -6,13 +6,14 @@
#include <lv_examples.h> */
TFT_eSPI tft = TFT_eSPI(); /* TFT instance */
static lv_disp_buf_t disp_buf;
static lv_color_t buf[LV_HOR_RES_MAX * 10];
/* Change to your screen resolution */
static uint32_t screenWidth = 320;
static uint32_t screenHeight = 240;
static lv_disp_buf_t disp_buf;
static lv_color_t buf[screenWidth * 10];
#if LV_USE_LOG != 0
/* Serial debugging */
void my_print(lv_log_level_t level, const char *file, uint32_t line, const char *fn_name, const char *dsc)
@ -81,14 +82,14 @@ void setup()
uint16_t calData[5] = {275, 3620, 264, 3532, 1};
tft.setTouch(calData);
lv_disp_buf_init(&disp_buf, buf, NULL, LV_HOR_RES_MAX * 10);
lv_disp_buf_init(&disp_buf, buf, NULL, screenWidth * 10);
/* Initialize the display */
lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv);
/* Change the following line to your display resolution */
disp_drv.hor_res = 320;
disp_drv.ver_res = 240;
disp_drv.hor_res = screenWidth;
disp_drv.ver_res = screenHeight;
disp_drv.flush_cb = my_disp_flush;
disp_drv.buffer = &disp_buf;
lv_disp_drv_register(&disp_drv);