mouse: Fix for endpoint refactor

This commit is contained in:
Cem Aksoylar 2023-10-02 22:36:33 -07:00 committed by urob
parent 951cc69f7c
commit 777b14e082

View file

@ -116,9 +116,7 @@ int zmk_endpoints_toggle_transport(void) {
return zmk_endpoints_select_transport(new_transport); return zmk_endpoints_select_transport(new_transport);
} }
struct zmk_endpoint_instance zmk_endpoints_selected(void) { struct zmk_endpoint_instance zmk_endpoints_selected(void) { return current_instance; }
return current_instance;
}
static int send_keyboard_report(void) { static int send_keyboard_report(void) {
struct zmk_hid_keyboard_report *keyboard_report = zmk_hid_get_keyboard_report(); struct zmk_hid_keyboard_report *keyboard_report = zmk_hid_get_keyboard_report();
@ -197,9 +195,9 @@ int zmk_endpoints_send_report(uint16_t usage_page) {
int zmk_endpoints_send_mouse_report() { int zmk_endpoints_send_mouse_report() {
struct zmk_hid_mouse_report *mouse_report = zmk_hid_get_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) #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)); int err = zmk_usb_hid_send_report((uint8_t *)mouse_report, sizeof(*mouse_report));
if (err) { if (err) {
LOG_ERR("FAILED TO SEND OVER USB: %d", err); LOG_ERR("FAILED TO SEND OVER USB: %d", err);
@ -209,7 +207,7 @@ int zmk_endpoints_send_mouse_report() {
#endif /* IS_ENABLED(CONFIG_ZMK_USB) */ #endif /* IS_ENABLED(CONFIG_ZMK_USB) */
#if IS_ENABLED(CONFIG_ZMK_BLE) #if IS_ENABLED(CONFIG_ZMK_BLE)
case ZMK_ENDPOINT_BLE: { case ZMK_TRANSPORT_BLE: {
int err = zmk_hog_send_mouse_report(&mouse_report->body); int err = zmk_hog_send_mouse_report(&mouse_report->body);
if (err) { if (err) {
LOG_ERR("FAILED TO SEND OVER HOG: %d", err); LOG_ERR("FAILED TO SEND OVER HOG: %d", err);
@ -219,7 +217,7 @@ int zmk_endpoints_send_mouse_report() {
#endif /* IS_ENABLED(CONFIG_ZMK_BLE) */ #endif /* IS_ENABLED(CONFIG_ZMK_BLE) */
default: default:
LOG_ERR("Unsupported endpoint %d", current_endpoint); LOG_ERR("Unsupported endpoint %d", current_instance.transport);
return -ENOTSUP; return -ENOTSUP;
} }
} }