Skip to content

Commit 037373b

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

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
@@ -56,15 +56,17 @@ SYS_INIT(enable_bkp_access, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
5656
#include <zephyr/input/input.h>
5757
typedef void (*zephyr_input_callback_t)(struct input_event *evt, void *user_data);
5858

59-
static zephyr_input_callback_t zephyr_input_cb = NULL;
59+
static zephyr_input_callback_t zephyr_input_cb_func = NULL;
60+
static void *zephyr_input_cb_data = NULL;
6061

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

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

0 commit comments

Comments
 (0)