初级会员

- 积分
- 117
- 金钱
- 117
- 注册时间
- 2020-4-29
- 在线时间
- 32 小时
|
发表于 2022-9-20 16:03:31
|
显示全部楼层
仿真了你的程序,创建屏幕时申请内存是失败的;
void lv_port_disp_init(void)
{
static lv_disp_buf_t disp_buf_1;
static lv_color_t buf1_1[LV_HOR_RES_MAX * 10]; /*A buffer for 10 rows*/
lv_disp_buf_init(&disp_buf_1, buf1_1, NULL, LV_HOR_RES_MAX * 10); /*Initialize the display buffer*/
lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/
lv_disp_drv_init(&disp_drv); /*Basic initialization*/
disp_drv.hor_res = LV_HOR_RES_MAX;
disp_drv.ver_res = LV_VER_RES_MAX;
/*Used to copy the buffer's content to the display*/
disp_drv.flush_cb = disp_flush;
disp_drv.buffer = &disp_buf_1;
/*Finally register the driver*/
lv_disp_drv_register(&disp_drv); //这里申请内存失败
}
求指点
|
|