介绍一下界面数据显示方法
/**
* Set a an event handler function for an object.
* Used by the user to react on event which happens with the object.
* @param obj pointer to an object
* @param event_cb the new event function
*/
void lv_obj_set_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb)/*对象事件回调设置函数*/
{
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
obj->event_cb = event_cb;
}
/**
* Send an event to the object
* @param obj pointer to an object
* @param event the type of the event from `lv_event_t`
* @param data arbitrary data depending on the object type and the event. (Usually `NULL`)
* @return LV_RES_OK: `obj` was not deleted in the event; LV_RES_INV: `obj` was deleted in the event
*/
lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data)/*对象事件发送函数*/
{
if(obj == NULL) return LV_RES_OK;
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
lv_res_t res;
res = lv_event_send_func(obj->event_cb, obj, event, data);
return res;
}
-事件对象初始化绑定事件对象
![在这里插入图片描述](https://img-blog.csdnimg.cn/7e0f585b037c42bc8e164369bff34c52.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAS0FNSSBTVFVESU8=,size_20,color_FFFFFF,t_70,g_se,x_16)
-更新回调函数编写
![在这里插入图片描述](https://img-blog.csdnimg.cn/68af9912dfc042728b3c2ad0f7fcf577.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAS0FNSSBTVFVESU8=,size_20,color_FFFFFF,t_70,g_se,x_16)
- 在其他任务中,数据更新送