Description
Trying to compile the Timer example.
But compilation fails (Use the user_data) with: a value of type "void *" cannot be used to initialize an entity of type "uint32_t *"
What MCU/Processor/Board and compiler are you using?
ESP32 with Arduino environment (c++)
What LVGL version are you using?
8.2
What do you want to achieve?
Compiling to succeed, and to understand why it doesn’t compile.
Code to reproduce
void my_timer(lv_timer_t * timer)
{
/*Use the user_data*/
uint32_t * user_data = timer->user_data;
printf("my_timer called with user data: %d\n", *user_data);
/*Do something with LVGL*/
if(something_happened) {
something_happened = false;
lv_btn_create(lv_scr_act(), NULL);
}
}
...
static uint32_t user_data = 10;
lv_timer_t * timer = lv_timer_create(my_timer, 500, &user_data);