diff --git a/app/src/mouse/key_listener.c b/app/src/mouse/key_listener.c index cc3f1762..4f804251 100644 --- a/app/src/mouse/key_listener.c +++ b/app/src/mouse/key_listener.c @@ -18,6 +18,8 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); #include #include +//TODO: There is probably a better flag to use here +#if(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL) static struct vector2d move_speed = {0}; static struct vector2d scroll_speed = {0}; static struct mouse_config move_config = (struct mouse_config){0}; @@ -45,8 +47,6 @@ void mouse_clear_cb(struct k_timer *dummy) { k_work_submit_to_queue(zmk_mouse_work_q(), &mouse_clear); } -//TODO: There is probably a better flag to use here -#if(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL) static void mouse_tick_timer_handler(struct k_work *work) { zmk_hid_mouse_movement_set(0, 0); zmk_hid_mouse_scroll_set(0, 0); diff --git a/app/src/mouse/tick_listener.c b/app/src/mouse/tick_listener.c index e9788499..37c0dcd3 100644 --- a/app/src/mouse/tick_listener.c +++ b/app/src/mouse/tick_listener.c @@ -16,6 +16,8 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); #include // CLAMP +//TODO: probably a better flag to use here +#if(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL) #if CONFIG_MINIMAL_LIBC static float powf(float base, float exponent) { // poor man's power implementation rounds the exponent down to the nearest integer. @@ -79,7 +81,6 @@ static struct vector2d update_movement(struct vector2d *remainder, return move; } -#if(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL) static void mouse_tick_handler(const struct zmk_mouse_tick *tick) { struct vector2d move = update_movement(&move_remainder, &(tick->move_config), tick->max_move, tick->timestamp, tick->start_time); @@ -90,18 +91,17 @@ static void mouse_tick_handler(const struct zmk_mouse_tick *tick) { zmk_hid_mouse_scroll_update((int8_t)CLAMP(scroll.x, INT8_MIN, INT8_MAX), (int8_t)CLAMP(scroll.y, INT8_MIN, INT8_MAX)); } -#endif int zmk_mouse_tick_listener(const zmk_event_t *eh) { const struct zmk_mouse_tick *tick = as_zmk_mouse_tick(eh); - #if(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL) if (tick) { mouse_tick_handler(tick); return 0; } - #endif return 0; } ZMK_LISTENER(zmk_mouse_tick_listener, zmk_mouse_tick_listener); -ZMK_SUBSCRIPTION(zmk_mouse_tick_listener, zmk_mouse_tick); \ No newline at end of file +ZMK_SUBSCRIPTION(zmk_mouse_tick_listener, zmk_mouse_tick); + +#endif /* CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL */ \ No newline at end of file