modules: lvgl: fix multiple LVGL inputs

The LVGL input callback does not use an instance specific name, so we
can only ever have one instance of this type. This issue was evident by
a build error, e.g., when using "zephyr,lvgl-keypad-input" nodes twice:

  error: redefinition of '_input_callback__lvgl_keypad_process_event'

Signed-off-by: Gero Schwäricke <gero.schwaericke@posteo.de>
This commit is contained in:
Gero Schwäricke 2024-09-24 22:41:22 +02:00 committed by Fabio Baltieri
parent 6ba6c66ab5
commit 5bcb5242ed

View file

@ -36,8 +36,8 @@ int lvgl_init_input_devices(void);
#define LVGL_KEY_VALID(key) IN_RANGE(key, 0, UINT8_MAX)
#define LVGL_INPUT_DEFINE(inst, type, msgq_size, process_evt_cb) \
INPUT_CALLBACK_DEFINE(LVGL_INPUT_DEVICE(inst), process_evt_cb, \
(void *)DEVICE_DT_INST_GET(inst)); \
INPUT_CALLBACK_DEFINE_NAMED(LVGL_INPUT_DEVICE(inst), process_evt_cb, \
(void *)DEVICE_DT_INST_GET(inst), process_evt_cb_##inst); \
K_MSGQ_DEFINE(lvgl_input_msgq_##type##_##inst, sizeof(lv_indev_data_t), msgq_size, 4)
#ifdef __cplusplus