From 31cfb97b7857ded3b0b292428bc4642576d41ae0 Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Mon, 6 Nov 2023 23:44:49 +0000 Subject: [PATCH] Cleanup of items for main changes. --- app/include/zmk/events/mouse_button_state_changed.h | 1 - app/include/zmk/mouse.h | 1 - app/src/behaviors/behavior_mouse_key_press.c | 6 +++--- app/src/endpoints.c | 13 ++++++------- app/src/events/mouse_button_state_changed.c | 1 - app/src/mouse.c | 2 +- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/app/include/zmk/events/mouse_button_state_changed.h b/app/include/zmk/events/mouse_button_state_changed.h index 6c3adae30d86..9382789e56f6 100644 --- a/app/include/zmk/events/mouse_button_state_changed.h +++ b/app/include/zmk/events/mouse_button_state_changed.h @@ -7,7 +7,6 @@ #pragma once -#include #include #include #include diff --git a/app/include/zmk/mouse.h b/app/include/zmk/mouse.h index e749ac5d6222..b48f0085743b 100644 --- a/app/include/zmk/mouse.h +++ b/app/include/zmk/mouse.h @@ -6,7 +6,6 @@ #pragma once -#include #include typedef uint16_t zmk_mouse_button_flags_t; diff --git a/app/src/behaviors/behavior_mouse_key_press.c b/app/src/behaviors/behavior_mouse_key_press.c index e5f2709cbf2d..60a23799d13c 100644 --- a/app/src/behaviors/behavior_mouse_key_press.c +++ b/app/src/behaviors/behavior_mouse_key_press.c @@ -6,9 +6,9 @@ #define DT_DRV_COMPAT zmk_behavior_mouse_key_press -#include +#include #include -#include +#include #include #include @@ -45,4 +45,4 @@ static const struct behavior_driver_api behavior_mouse_key_press_driver_api = { DT_INST_FOREACH_STATUS_OKAY(KP_INST) -#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ \ No newline at end of file +#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ diff --git a/app/src/endpoints.c b/app/src/endpoints.c index 0eb35ee95afc..7d7a8a554b0c 100644 --- a/app/src/endpoints.c +++ b/app/src/endpoints.c @@ -196,9 +196,9 @@ int zmk_endpoints_send_report(uint16_t usage_page) { int zmk_endpoints_send_mouse_report() { struct zmk_hid_mouse_report *mouse_report = zmk_hid_get_mouse_report(); - switch (current_endpoint) { + switch (current_instance.transport) { #if IS_ENABLED(CONFIG_ZMK_USB) - case ZMK_ENDPOINT_USB: { + case ZMK_TRANSPORT_USB: { int err = zmk_usb_hid_send_report((uint8_t *)mouse_report, sizeof(*mouse_report)); if (err) { LOG_ERR("FAILED TO SEND OVER USB: %d", err); @@ -208,7 +208,7 @@ int zmk_endpoints_send_mouse_report() { #endif /* IS_ENABLED(CONFIG_ZMK_USB) */ #if IS_ENABLED(CONFIG_ZMK_BLE) - case ZMK_ENDPOINT_BLE: { + case ZMK_TRANSPORT_BLE: { int err = zmk_hog_send_mouse_report(&mouse_report->body); if (err) { LOG_ERR("FAILED TO SEND OVER HOG: %d", err); @@ -216,11 +216,10 @@ int zmk_endpoints_send_mouse_report() { return err; } #endif /* IS_ENABLED(CONFIG_ZMK_BLE) */ - - default: - LOG_ERR("Unsupported endpoint %d", current_endpoint); - return -ENOTSUP; } + + LOG_ERR("Unsupported endpoint transport %d", current_instance.transport); + return -ENOTSUP; } #if IS_ENABLED(CONFIG_SETTINGS) diff --git a/app/src/events/mouse_button_state_changed.c b/app/src/events/mouse_button_state_changed.c index e1ede4142175..419a7ce956d4 100644 --- a/app/src/events/mouse_button_state_changed.c +++ b/app/src/events/mouse_button_state_changed.c @@ -4,7 +4,6 @@ * SPDX-License-Identifier: MIT */ -#include #include ZMK_EVENT_IMPL(zmk_mouse_button_state_changed); diff --git a/app/src/mouse.c b/app/src/mouse.c index a02d6dd0e93a..c1b9ac0261e2 100644 --- a/app/src/mouse.c +++ b/app/src/mouse.c @@ -5,7 +5,7 @@ */ #include -#include +#include LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);