Skip to content

Commit

Permalink
Cleanup of items for main changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
petejohanson committed Nov 6, 2023
1 parent b965f57 commit 31cfb97
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
1 change: 0 additions & 1 deletion app/include/zmk/events/mouse_button_state_changed.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#pragma once

#include <zephyr.h>
#include <zmk/hid.h>
#include <zmk/event_manager.h>
#include <zmk/mouse.h>
Expand Down
1 change: 0 additions & 1 deletion app/include/zmk/mouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#pragma once

#include <zephyr.h>
#include <dt-bindings/zmk/mouse.h>

typedef uint16_t zmk_mouse_button_flags_t;
Expand Down
6 changes: 3 additions & 3 deletions app/src/behaviors/behavior_mouse_key_press.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#define DT_DRV_COMPAT zmk_behavior_mouse_key_press

#include <device.h>
#include <zephyr/device.h>
#include <drivers/behavior.h>
#include <logging/log.h>
#include <zephyr/logging/log.h>

#include <zmk/behavior.h>
#include <zmk/event_manager.h>
Expand Down Expand Up @@ -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) */
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */
13 changes: 6 additions & 7 deletions app/src/endpoints.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -208,19 +208,18 @@ 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);
}
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)
Expand Down
1 change: 0 additions & 1 deletion app/src/events/mouse_button_state_changed.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* SPDX-License-Identifier: MIT
*/

#include <kernel.h>
#include <zmk/events/mouse_button_state_changed.h>

ZMK_EVENT_IMPL(zmk_mouse_button_state_changed);
2 changes: 1 addition & 1 deletion app/src/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include <drivers/behavior.h>
#include <logging/log.h>
#include <zephyr/logging/log.h>

LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);

Expand Down

0 comments on commit 31cfb97

Please sign in to comment.