From 600bba25f049b1fa161b2372b2a47762164c7fcd Mon Sep 17 00:00:00 2001 From: Joel Spadin Date: Sat, 24 Oct 2020 16:28:58 -0500 Subject: feat(endpoints): add preferred endpoint setting Added a new setting to remember the user's preferred endpoint. When both USB and BLE are connected, the preferred endpoint will be used. Added a new behavior to control this setting. It supports commands: &end END_USB - Prefer USB output &end END_BLE - Prefer BLE output &end END_TOG - Toggle between USB and BLE --- app/include/dt-bindings/zmk/endpoints.h | 13 +++++++++++++ app/include/zmk/endpoints.h | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100644 app/include/dt-bindings/zmk/endpoints.h (limited to 'app/include') diff --git a/app/include/dt-bindings/zmk/endpoints.h b/app/include/dt-bindings/zmk/endpoints.h new file mode 100644 index 0000000..3bba972 --- /dev/null +++ b/app/include/dt-bindings/zmk/endpoints.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#define ENDPOINT_TOGGLE_CMD 0 +#define ENDPOINT_USB_CMD 1 +#define ENDPOINT_BLE_CMD 2 + +#define END_TOG ENDPOINT_TOGGLE_CMD +#define END_USB ENDPOINT_USB_CMD +#define END_BLE ENDPOINT_BLE_CMD \ No newline at end of file diff --git a/app/include/zmk/endpoints.h b/app/include/zmk/endpoints.h index aad6265..aad688e 100644 --- a/app/include/zmk/endpoints.h +++ b/app/include/zmk/endpoints.h @@ -9,4 +9,12 @@ #include #include +enum zmk_endpoint { + ZMK_ENDPOINT_USB, + ZMK_ENDPOINT_BLE, +}; + +int zmk_endpoints_select(enum zmk_endpoint endpoint); +int zmk_endpoints_toggle(); + int zmk_endpoints_send_report(u8_t usage_report); -- cgit v1.2.3