LVGL Release v8.0编译报错(20211213)


./lvgl/examples/porting/lv_port_disp.c: In function ‘lv_port_disp_init’:
./lvgl/examples/porting/lv_port_disp.c:78:29: error: ‘MY_DISP_HOR_RES’ undeclared (first use in this function)
     static lv_color_t buf_1[MY_DISP_HOR_RES * 10];                          /*A buffer for 10 rows*/
                             ^
./lvgl/examples/porting/lv_port_disp.c:78:29: note: each undeclared identifier is reported only once for each function it appears in
./lvgl/examples/porting/lv_port_disp.c:89:49: error: ‘MY_DISP_VER_RES’ undeclared (first use in this function)
     static lv_color_t buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES];            /*A screen sized buffer*/
                                                 ^
./lvgl/examples/porting/lv_port_disp.c:91:53: error: ‘buf_3_2’ undeclared (first use in this function)
     lv_disp_draw_buf_init(&draw_buf_dsc_3, buf_3_1, buf_3_2, MY_DISP_VER_RES * LV_VER_RES_MAX);   /*Initialize the display bu
                                                     ^
./lvgl/examples/porting/lv_port_disp.c:90:23: warning: unused variable ‘buf_3_1’ [-Wunused-variable]
     static lv_color_t buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES];            /*An other screen sized buffer*/
                       ^
./lvgl/examples/porting/lv_port_disp.c:84:23: warning: unused variable ‘buf_2_1’ [-Wunused-variable]
     static lv_color_t buf_2_1[MY_DISP_HOR_RES * 10];                        /*An other buffer for 10 rows*/
                       ^
./lvgl/examples/porting/lv_port_disp.c:78:23: warning: unused variable ‘buf_1’ [-Wunused-variable]
     static lv_color_t buf_1[MY_DISP_HOR_RES * 10];                          /*A buffer for 10 rows*/
                       ^
gcc.mk:128: recipe for target '.obj/./lvgl/examples/porting/lv_port_disp.o' failed
make: *** [.obj/./lvgl/examples/porting/lv_port_disp.o] Error 1

lv_conf.h

#define LV_HOR_RES_MAX          (460)//屏幕宽
#define LV_VER_RES_MAX          (360)//屏幕高
#define MY_DISP_HOR_RES         LV_HOR_RES_MAX

lvgl\examples\porting\lv_port_disp.c


    /* Example for 1) */
    static lv_disp_draw_buf_t draw_buf_dsc_1;
    static lv_color_t buf_1[MY_DISP_HOR_RES * 10];                          /*A buffer for 10 rows*/
    lv_disp_draw_buf_init(&draw_buf_dsc_1, buf_1, NULL, MY_DISP_HOR_RES * 10);   /*Initialize the display buffer*/

#if 0
    /* Example for 2) */
    static lv_disp_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_disp_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) also set disp_drv.full_refresh = 1 below*/
    static lv_disp_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_disp_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*/
#endif