diff options
author | Peter Johanson <peter@peterjohanson.com> | 2021-08-02 21:44:01 -0400 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2021-08-03 00:19:05 -0400 |
commit | d05d7ec2d2b40ca40339b4d7cceb31974bac0e94 (patch) | |
tree | 37e3f90b46e3e5c01146f1d9c505b7e05d1d5e95 /app/include | |
parent | 9d34cf561e11682840e10283f0a6947547a649b5 (diff) |
feat(endpoints): Add endpoint select changed event.
Diffstat (limited to 'app/include')
-rw-r--r-- | app/include/zmk/endpoints.h | 8 | ||||
-rw-r--r-- | app/include/zmk/endpoints_types.h | 12 | ||||
-rw-r--r-- | app/include/zmk/events/endpoint_selection_changed.h | 18 |
3 files changed, 31 insertions, 7 deletions
diff --git a/app/include/zmk/endpoints.h b/app/include/zmk/endpoints.h index 0d2bbce..c886053 100644 --- a/app/include/zmk/endpoints.h +++ b/app/include/zmk/endpoints.h @@ -6,13 +6,7 @@ #pragma once -#include <zmk/keys.h> -#include <zmk/hid.h> - -enum zmk_endpoint { - ZMK_ENDPOINT_USB, - ZMK_ENDPOINT_BLE, -}; +#include <zmk/endpoints_types.h> int zmk_endpoints_select(enum zmk_endpoint endpoint); int zmk_endpoints_toggle(); diff --git a/app/include/zmk/endpoints_types.h b/app/include/zmk/endpoints_types.h new file mode 100644 index 0000000..70804a6 --- /dev/null +++ b/app/include/zmk/endpoints_types.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2021 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +enum zmk_endpoint { + ZMK_ENDPOINT_USB, + ZMK_ENDPOINT_BLE, +}; diff --git a/app/include/zmk/events/endpoint_selection_changed.h b/app/include/zmk/events/endpoint_selection_changed.h new file mode 100644 index 0000000..38a6a8e --- /dev/null +++ b/app/include/zmk/events/endpoint_selection_changed.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2021 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include <zephyr.h> + +#include <zmk/endpoints_types.h> +#include <zmk/event_manager.h> + +struct zmk_endpoint_selection_changed { + enum zmk_endpoint endpoint; +}; + +ZMK_EVENT_DECLARE(zmk_endpoint_selection_changed); |