How to simply use time delay in lvgl?


What MCU/Processor/Board and compiler are you using?


What LVGL version are you using?


What do you want to achieve?


What have you tried so far?

I currently use a timer before the operation, but he seems to be in parallel and cannot delay the time before executing the operation.

/You code here/
example:disable a button, then restore it after 5 seconds
lv_obj_add_state(btn, LV_STATE_DISABLED);
lv_timer_t* sleeptimer = lv_timer_create(sleep_timer, 5000, 0);
lv_timer_set_repeat_count(sleeptimer, 1);
lv_obj_clear_state(btn, LV_STATE_DISABLED);
now this button will be restored immediately。。。。。

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

Missing a function, even though it doesn’t do anything
void sleep_timer(lv_timer_t* timer)


printf("nothing to do\n");