fix(comment): remove the space after /* and before */
This commit is contained in:
@@ -1,25 +1,21 @@
|
||||
#include <lvgl.h>
|
||||
#include <TFT_eSPI.h>
|
||||
/* If you want to use the LVGL examples,
|
||||
make sure to install the lv_examples Arduino library
|
||||
and uncomment the following line.
|
||||
#include <lv_examples.h> */
|
||||
/*If you want to use the LVGL examples,
|
||||
make sure to install the lv_examples Arduino library
|
||||
and uncomment the following line.
|
||||
#include <lv_examples.h>*/
|
||||
|
||||
TFT_eSPI tft = TFT_eSPI(); /* TFT instance */
|
||||
TFT_eSPI tft = TFT_eSPI(); /*TFT instance*/
|
||||
|
||||
/* Change to your screen resolution */
|
||||
/*Change to your screen resolution*/
|
||||
static uint32_t screenWidth = 320;
|
||||
static uint32_t screenHeight = 240;
|
||||
|
||||
<<<<<<< HEAD
|
||||
static lv_disp_buf_t disp_buf;
|
||||
=======
|
||||
static lv_draw_buf_t draw_buf;
|
||||
>>>>>>> xiaoxiang781216-disp
|
||||
static lv_color_t buf[screenWidth * 10];
|
||||
|
||||
#if LV_USE_LOG != 0
|
||||
/* Serial debugging */
|
||||
/*Serial debugging*/
|
||||
void my_print(lv_log_level_t level, const char *file, uint32_t line, const char *fn_name, const char *dsc)
|
||||
{
|
||||
Serial.printf("%s(%s)@%d->%s\r\n", file, fn_name, line, dsc);
|
||||
@@ -27,7 +23,7 @@ void my_print(lv_log_level_t level, const char *file, uint32_t line, const char
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Display flushing */
|
||||
/*Display flushing*/
|
||||
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
|
||||
{
|
||||
uint32_t w = (area->x2 - area->x1 + 1);
|
||||
@@ -69,49 +65,49 @@ bool my_touchpad_read(lv_indev_drv_t *indev_driver, lv_indev_data_t *data)
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200); /* prepare for possible serial debug */
|
||||
Serial.begin(115200); /*prepare for possible serial debug*/
|
||||
|
||||
lv_init();
|
||||
|
||||
#if LV_USE_LOG != 0
|
||||
lv_log_register_print_cb(my_print); /* register print function for debugging */
|
||||
lv_log_register_print_cb(my_print); /*register print function for debugging*/
|
||||
#endif
|
||||
|
||||
tft.begin(); /* TFT init */
|
||||
tft.setRotation(1); /* Landscape orientation */
|
||||
tft.begin(); /*TFT init*/
|
||||
tft.setRotation(1); /*Landscape orientation*/
|
||||
|
||||
/* Set the touchscreen calibration data,
|
||||
the actual data for your display can be aquired using
|
||||
the Generic -> Touch_calibrate example from the TFT_eSPI library */
|
||||
/*Set the touchscreen calibration data,
|
||||
the actual data for your display can be aquired using
|
||||
the Generic -> Touch_calibrate example from the TFT_eSPI library*/
|
||||
uint16_t calData[5] = {275, 3620, 264, 3532, 1};
|
||||
tft.setTouch(calData);
|
||||
|
||||
lv_draw_buf_init(&draw_buf, buf, NULL, screenWidth * 10);
|
||||
|
||||
/* Initialize the display */
|
||||
/*Initialize the display*/
|
||||
lv_disp_drv_t disp_drv;
|
||||
lv_disp_drv_init(&disp_drv);
|
||||
/* Change the following line to your display resolution */
|
||||
/*Change the following line to your display resolution*/
|
||||
disp_drv.hor_res = screenWidth;
|
||||
disp_drv.ver_res = screenHeight;
|
||||
disp_drv.flush_cb = my_disp_flush;
|
||||
disp_drv.draw_buf = &draw_buf;
|
||||
lv_disp_drv_register(&disp_drv);
|
||||
|
||||
/* Initialize the (dummy) input device driver */
|
||||
/*Initialize the (dummy) input device driver*/
|
||||
lv_indev_drv_t indev_drv;
|
||||
lv_indev_drv_init(&indev_drv);
|
||||
indev_drv.type = LV_INDEV_TYPE_POINTER;
|
||||
indev_drv.read_cb = my_touchpad_read;
|
||||
lv_indev_drv_register(&indev_drv);
|
||||
|
||||
/* Try an example from the lv_examples Arduino library
|
||||
make sure to include it as written above.
|
||||
lv_example_btn_1(); */
|
||||
/*Try an example from the lv_examples Arduino library
|
||||
make sure to include it as written above.
|
||||
lv_example_btn_1();*/
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
lv_timer_handler(); /* let the GUI do its work */
|
||||
lv_timer_handler(); /*let the GUI do its work*/
|
||||
delay(5);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user