Skip to content

Commit acbf570

Browse files
committed
loader: Add input callback data.
Signed-off-by: iabdalkader <[email protected]>
1 parent a26551e commit acbf570

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

loader/fixups.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,17 @@ SYS_INIT(enable_bkp_access, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
5757
#include <zephyr/input/input.h>
5858
typedef void (*zephyr_input_callback_t)(struct input_event *evt, void *user_data);
5959

60-
static zephyr_input_callback_t zephyr_input_cb = NULL;
60+
static zephyr_input_callback_t zephyr_input_cb_func = NULL;
61+
static void *zephyr_input_cb_data = NULL;
6162

62-
void zephyr_input_register_callback(zephyr_input_callback_t cb) {
63-
zephyr_input_cb = cb;
63+
void zephyr_input_register_callback(zephyr_input_callback_t cb, void *user_data) {
64+
zephyr_input_cb_func = cb;
65+
zephyr_input_cb_data = user_data;
6466
}
6567

6668
static void zephyr_input_callback(struct input_event *evt, void *user_data) {
67-
if (zephyr_input_cb) {
68-
zephyr_input_cb(evt, user_data);
69+
if (zephyr_input_cb_func) {
70+
zephyr_input_cb_func(evt, zephyr_input_cb_data);
6971
}
7072
}
7173

0 commit comments

Comments
 (0)