aboutsummaryrefslogtreecommitdiff
path: root/examples/arduino
diff options
context:
space:
mode:
authorXiang Xiao <xiaoxiang@xiaomi.com>2021-03-12 15:46:23 +0800
committerXiang Xiao <xiaoxiang@xiaomi.com>2021-03-14 21:10:58 +0800
commit1da95cf534e22a8085314dd6e95decf85b406d9c (patch)
tree8b657b5471688a04c4442229d52b7f05ce7a5328 /examples/arduino
parent460b227b8360706984ff924c82a3fe50c668c77f (diff)
downloadlvgl-1da95cf534e22a8085314dd6e95decf85b406d9c.tar.gz
lvgl-1da95cf534e22a8085314dd6e95decf85b406d9c.zip
fix(example): replace LV_HOR_RES_MAX with 320 in LVGL_Arduino.ino
since LV_HOR_RES_MAX doesn't exist anymore
Diffstat (limited to 'examples/arduino')
-rw-r--r--examples/arduino/LVGL_Arduino.ino11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/arduino/LVGL_Arduino.ino b/examples/arduino/LVGL_Arduino.ino
index 911ce7633..d1f544c6b 100644
--- a/examples/arduino/LVGL_Arduino.ino
+++ b/examples/arduino/LVGL_Arduino.ino
@@ -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);