8.2.0软件软件
软件包里面的5个模板移植
lv_conf.h;lv_port_disp.h;lv_port_disp.c;lv_port_indev.h;lv_port_indev.c五个文件,在lv_port_disp.c中定义:
#define MY_DISP_HOR_RES 800
#define MY_DISP_VER_RES 480
#define LV_VER_RES_MAX MY_DISP_HOR_RES
注解掉
// /* 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_2[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_2, 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_2[MY_DISP_HOR_RES * MY_DISP_VER_RES]; /Another 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/
编译后报如下错误
`` 01:44:36 **** Incremental Build of configuration Debug for project FK-F429BIT6M2-LTDC-LVGL **** make -j8 all linking... ./packages/LVGL-v8.2.0/src/misc/lv_printf.o: In functionrt_snprintf':
E:\workspace\FK_F429M2\FK-F429BIT6M2-LTDC-LVGL\Debug/../packages/LVGL-v8.2.0/src/misc/lv_printf.c866 multiple definition of `rt_snprintf'
. /rt-thread/src/kservice.oE\workspace\FK_F429M2\FK-F429BIT6M2-LTDC-LVGL\Debug/../rt-thread/src/kservice.c1131 首先在这里定义
collect2.exe: error: ld returned 1 exit status
make: * [makefile109 rtthread.elf] 错误 1
“make -j8 all”以退出代码 2 终止。构建可能不完整。
01:44:39 构建失败。3 个错误,0 个警告。(耗时 2s.654ms)
错误定位一下两个函数之间存在重复定义:
int lv_snprintf(char buffer, size_t count, const char format, …)
{
va_list va;
va_start(va,格式);
const int ret = _vsnprintf(_out_buffer, buffer, count, format, va);
va_end(va);
返还;
}
int rt_snprintf(char *buf, rt_size_t size, const char *fmt, ...)
{
rt_int32_t n;
va_list args;
va_start(args, fmt);
n = rt_vsnprintf(buf, size, fmt, args);
va_end(args);
return n;
}
5.使用littlevGL2RTT软件包不存在这个问题,后在cubemx修改栈为0x1000问题也没有解决,重新构建工程多次也不行,应该怎么解决?
更多回帖