Animation wont start

Hi all
I need to use the lvgl lib version 8.4.0 and I wnat create a anmitation that update every second a text field. I was able create the textfiel and wirte in it.

I have the created to functions, one for setting up the animation, and one for calling every 1 sewcond

void lv_label_set_time(void* text_label_value, int32_t v) {
    Serial.println("lv_label_set_time");
    char time_str_[9];
    time_t now_ = time(nullptr);
    struct tm* timeinfo_ = localtime(&now_);
    sprintf(time_str_, "%02d:%02d:%02d", timeinfo_->tm_hour, timeinfo_->tm_min, timeinfo_->tm_sec);
    
    lv_label_set_text((lv_obj_t*)text_label_value, time_str_);

    Serial.println(time_str_);
}

void lv_create_anim_update_time(void) {
    // Create an animation to update the time every second
    lv_anim_t a_;
    lv_anim_init(&a_);

    lv_anim_set_var(&a_, text_label_time_value);
    lv_anim_set_values(&a_, 0, 59);
    lv_anim_set_time(&a_, 1000); 
    lv_anim_set_repeat_count(&a_, LV_ANIM_REPEAT_INFINITE); 

    lv_anim_set_exec_cb(&a_, (lv_anim_exec_xcb_t)lv_label_set_time);

    lv_anim_start(&a_);
    Serial.println("Animation started");
}

void loop(){
    lv_task_handler();  // let the GUI do its work
    lv_tick_inc(5);     // tell LVGL how much time has passed
    delay(5);           // let this time pass
}

lv_label_set_time is called once at the creation time, but then it is not anymore called. Any idea why it is not working?

Animations isnt designed for this purpose, but can be used.
For change text is more flexible use lv timer.

Thanks @Marian_M

I have created a call back method for the timer

void lv_label_set_datetime(lv_timer_t* timer) {
	Serial.println("lv_label_set_datetime");
}

I intizalize the timer in setup this way

type or paste code here

I create the UI

    Serial.println("Create UI");
    /* Lock the mutex due to the LVGL APIs are not thread-safe */
    lvgl_port_lock(-1);

    lv_create_main_ui();

    lv_timer_t* timer_time_ = lv_timer_create(lv_label_set_datetime, 1000, NULL);
    lv_timer_ready(timer_time_);

    /* Release the mutex */
    lvgl_port_unlock();

As soon I add this line to the loop

    lv_timer_handler();

The program is not running anymore. To I forgot something?

It seams that I have not to add

lv_timer_handler

The timer will be executed without this line

You read docu or completely not?
Timer cb func is normal with parameter as describe docu

void (*lv_timer_cb_t)(lv_timer_t *) prototype

and this isnt required

lv_timer_ready(timer_time_);

and all this work only if lvgl tick is ok handled.