What MCU/Processor/Board and compiler are you using?
STM32H743
What LVGL version are you using?
8.2 - 8.3
What do you want to achieve?
I want to force the event handler to change only the necessary parameters corresponding to specific menu items.
What have you tried so far?
I used the sample menu code: Menu (lv_menu) — LVGL documentation
In the ‘create_slider’ function I added a line specifying the event handler:
lv_obj_add_event_cb(slider, slider_handler, LV_EVENT_ALL, NULL);
The handler function was created:
static void slider_handler(lv_event_t* e)
{
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t* obj = lv_event_get_target(e);
if(code == LV_EVENT_VALUE_CHANGED) {
LED_Bright (true);
}
}
With this approach, there is only one slider handler, and it will work when setting up any slider.
The question is, how do I get this handler to respond only to the desired slider?