Description
What MCU/Processor/Board and compiler are you using?
I am using the ESP32-C6 micro controller with a small SSD1306 LCD screen.
What LVGL version are you using?
I am using version 8.3.11
What do you want to achieve?
I want to update the screen continuously (every lvgl iteration) so that I can show constantly changing variables like time.
What have you tried so far?
I tried lv_refr_now
, but (I think) it recurses inside the LV_EVENT_DRAW_PART_BEGIN
callback and crashes the stack.
Code to reproduce
// Display an incrementing varible on every draw:
void ev_label_draw_cb(lv_event_t *e)
{
static long x;
lv_obj_t *menu_cont = lv_event_get_target(e);
lv_obj_t *label = lv_obj_get_child(menu_cont, 0);
lv_label_set_text_fmt(label, "%ld", x);
x++;
}
void init()
{
...
// Other initialization exist above the label creation, but
// we only care about the label for this question:
lv_obj_t *label = lv_label_create(cont);
lv_label_set_text(label, "");
lv_obj_add_event_cb(cont, ev_label_draw_cb, LV_EVENT_DRAW_PART_BEGIN, NULL);
...
}
I know you want it to run in the simulator, and if you need that I will make it run in the simulator, but if you can figure it out or provide me with a hint by just looking at the code here, that would be great.