diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 7a12a812..0ffd391e 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -30,7 +30,6 @@ target_sources(app PRIVATE src/hid.c) target_sources(app PRIVATE src/sensors.c) target_sources_ifdef(CONFIG_ZMK_DISPLAY app PRIVATE src/display.c) target_sources(app PRIVATE src/event_manager.c) -target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/ble_unpair_combo.c) target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/ext_power_generic.c) target_sources(app PRIVATE src/events/position_state_changed.c) target_sources(app PRIVATE src/events/keycode_state_changed.c) diff --git a/app/boards/shields/corne/corne.dtsi b/app/boards/shields/corne/corne.dtsi index af14bae9..4360aea7 100644 --- a/app/boards/shields/corne/corne.dtsi +++ b/app/boards/shields/corne/corne.dtsi @@ -58,10 +58,6 @@ RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10 }; - bt_unpair_combo: bt_unpair_combo { - compatible = "zmk,bt-unpair-combo"; - }; - // TODO: per-key RGB node(s)? }; diff --git a/app/boards/shields/corne/corne_left.overlay b/app/boards/shields/corne/corne_left.overlay index f12c417d..399bddd1 100644 --- a/app/boards/shields/corne/corne_left.overlay +++ b/app/boards/shields/corne/corne_left.overlay @@ -16,7 +16,3 @@ , <&pro_micro_d 14 GPIO_ACTIVE_HIGH> ; }; - -&bt_unpair_combo { - key-positions = <0 38>; -}; diff --git a/app/boards/shields/corne/corne_right.overlay b/app/boards/shields/corne/corne_right.overlay index 9d97d853..4250ac55 100644 --- a/app/boards/shields/corne/corne_right.overlay +++ b/app/boards/shields/corne/corne_right.overlay @@ -20,7 +20,3 @@ , <&pro_micro_a 3 GPIO_ACTIVE_HIGH> ; }; - -&bt_unpair_combo { - key-positions = <11 39>; -}; diff --git a/app/boards/shields/iris/iris.dtsi b/app/boards/shields/iris/iris.dtsi index f6e32c40..9ea1dd68 100644 --- a/app/boards/shields/iris/iris.dtsi +++ b/app/boards/shields/iris/iris.dtsi @@ -44,8 +44,4 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,2) RC(4,9) RC(3,6) RC(3,7) ; }; - - bt_unpair_combo: bt_unpair_combo { - compatible = "zmk,bt-unpair-combo"; - }; }; \ No newline at end of file diff --git a/app/boards/shields/iris/iris_left.overlay b/app/boards/shields/iris/iris_left.overlay index e04638e3..7ded678b 100644 --- a/app/boards/shields/iris/iris_left.overlay +++ b/app/boards/shields/iris/iris_left.overlay @@ -16,7 +16,3 @@ , <&pro_micro_d 10 GPIO_ACTIVE_HIGH> ; }; - -&bt_unpair_combo { - key-positions = <0 42>; -}; diff --git a/app/boards/shields/iris/iris_right.overlay b/app/boards/shields/iris/iris_right.overlay index 2d5dce87..51965821 100644 --- a/app/boards/shields/iris/iris_right.overlay +++ b/app/boards/shields/iris/iris_right.overlay @@ -20,7 +20,3 @@ , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> ; }; - -&bt_unpair_combo { - key-positions = <11 43>; -}; diff --git a/app/boards/shields/kyria/kyria.dtsi b/app/boards/shields/kyria/kyria.dtsi index a13f7f08..bbead846 100644 --- a/app/boards/shields/kyria/kyria.dtsi +++ b/app/boards/shields/kyria/kyria.dtsi @@ -81,10 +81,6 @@ RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) sensors = <&left_encoder &right_encoder>; }; - bt_unpair_combo: bt_unpair_combo { - compatible = "zmk,bt-unpair-combo"; - }; - // TODO: RGB node(s) }; diff --git a/app/boards/shields/kyria/kyria_left.overlay b/app/boards/shields/kyria/kyria_left.overlay index 441c1a69..c8b5be27 100644 --- a/app/boards/shields/kyria/kyria_left.overlay +++ b/app/boards/shields/kyria/kyria_left.overlay @@ -22,7 +22,3 @@ &left_encoder { status = "okay"; }; - -&bt_unpair_combo { - key-positions = <0 44>; -}; \ No newline at end of file diff --git a/app/boards/shields/kyria/kyria_right.overlay b/app/boards/shields/kyria/kyria_right.overlay index 8ee0fcbc..8163c95e 100644 --- a/app/boards/shields/kyria/kyria_right.overlay +++ b/app/boards/shields/kyria/kyria_right.overlay @@ -27,7 +27,3 @@ &right_encoder { status = "okay"; }; - -&bt_unpair_combo { - key-positions = <11 45>; -}; \ No newline at end of file diff --git a/app/boards/shields/lily58/lily58.dtsi b/app/boards/shields/lily58/lily58.dtsi index 556909fd..eb69fa75 100644 --- a/app/boards/shields/lily58/lily58.dtsi +++ b/app/boards/shields/lily58/lily58.dtsi @@ -57,10 +57,6 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7) compatible = "zmk,keymap-sensors"; sensors = <&left_encoder>; }; - - bt_unpair_combo: bt_unpair_combo { - compatible = "zmk,bt-unpair-combo"; - }; }; &pro_micro_i2c { diff --git a/app/boards/shields/lily58/lily58_left.overlay b/app/boards/shields/lily58/lily58_left.overlay index 1752b6e4..7397f188 100644 --- a/app/boards/shields/lily58/lily58_left.overlay +++ b/app/boards/shields/lily58/lily58_left.overlay @@ -20,7 +20,3 @@ &left_encoder { status = "okay"; }; - -&bt_unpair_combo { - key-positions = <0 53>; -}; diff --git a/app/boards/shields/lily58/lily58_right.overlay b/app/boards/shields/lily58/lily58_right.overlay index 6c8e493d..4fc460cf 100644 --- a/app/boards/shields/lily58/lily58_right.overlay +++ b/app/boards/shields/lily58/lily58_right.overlay @@ -20,7 +20,3 @@ , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> ; }; - -&bt_unpair_combo { - key-positions = <11 54>; -}; diff --git a/app/boards/shields/m60/m60.overlay b/app/boards/shields/m60/m60.overlay index babae2db..0824f1c6 100644 --- a/app/boards/shields/m60/m60.overlay +++ b/app/boards/shields/m60/m60.overlay @@ -56,11 +56,5 @@ RC(6,4) RC(6,3) RC(6,2) RC(6,1) RC(6,0) RC(5,7) RC(5,6) RC(5,5) RC(5,4) RC RC(6,5) RC(6,6) RC(6,7) RC(7,0) RC(7,1) RC(7,2) RC(7,3) RC(7,4) >; }; - - bt_unpair_combo: bt_unpair_combo { - compatible = "zmk,bt-unpair-combo"; - key-positions = <0 53>; - }; - }; diff --git a/app/boards/shields/romac/romac.overlay b/app/boards/shields/romac/romac.overlay index 67d5868b..f6b0f726 100644 --- a/app/boards/shields/romac/romac.overlay +++ b/app/boards/shields/romac/romac.overlay @@ -30,11 +30,5 @@ ; }; - - bt_unpair_combo: bt_unpair_combo { - compatible = "zmk,bt-unpair-combo"; - key-positions = <0 11>; - }; - }; diff --git a/app/boards/shields/sofle/sofle.dtsi b/app/boards/shields/sofle/sofle.dtsi index bff42f6f..b4edb5f6 100644 --- a/app/boards/shields/sofle/sofle.dtsi +++ b/app/boards/shields/sofle/sofle.dtsi @@ -66,10 +66,6 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7) compatible = "zmk,keymap-sensors"; sensors = <&left_encoder &right_encoder>; }; - - bt_unpair_combo: bt_unpair_combo { - compatible = "zmk,bt-unpair-combo"; - }; }; &pro_micro_i2c { diff --git a/app/boards/shields/sofle/sofle_left.overlay b/app/boards/shields/sofle/sofle_left.overlay index 0dfb7535..eb2bfeda 100644 --- a/app/boards/shields/sofle/sofle_left.overlay +++ b/app/boards/shields/sofle/sofle_left.overlay @@ -20,7 +20,3 @@ &left_encoder { status = "okay"; }; - -&bt_unpair_combo { - key-positions = <0 54>; -}; diff --git a/app/boards/shields/sofle/sofle_right.overlay b/app/boards/shields/sofle/sofle_right.overlay index 8eaf076d..c35cf52c 100644 --- a/app/boards/shields/sofle/sofle_right.overlay +++ b/app/boards/shields/sofle/sofle_right.overlay @@ -24,7 +24,3 @@ &right_encoder { status = "okay"; }; - -&bt_unpair_combo { - key-positions = <11 55>; -}; diff --git a/app/dts/bindings/zmk,bt-unpair-combo.yaml b/app/dts/bindings/zmk,bt-unpair-combo.yaml deleted file mode 100644 index d781347a..00000000 --- a/app/dts/bindings/zmk,bt-unpair-combo.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2020, Pete Johanson -# SPDX-License-Identifier: MIT - -description: | - Defines a set of key positions that will unpair all BT devices if held on startup. - -compatible: "zmk,bt-unpair-combo" - -properties: - key-positions: - type: array - required: true diff --git a/app/src/ble_unpair_combo.c b/app/src/ble_unpair_combo.c deleted file mode 100644 index b6e542de..00000000 --- a/app/src/ble_unpair_combo.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include -#include - -#define DT_DRV_COMPAT zmk_bt_unpair_combo - -#if DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) - -#include -LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); - -#include -#include -#include - -static u8_t combo_state; - -const u32_t key_positions[] = DT_INST_PROP(0, key_positions); -#define KP_LEN DT_INST_PROP_LEN(0, key_positions) - -int index_for_key_position(u32_t kp) { - for (int i = 0; i < KP_LEN; i++) { - if (key_positions[i] == kp) { - return i; - } - } - - return -1; -} - -int unpair_combo_listener(const struct zmk_event_header *eh) { - if (is_position_state_changed(eh)) { - const struct position_state_changed *psc = cast_position_state_changed(eh); - - int kp_index = index_for_key_position(psc->position); - if (kp_index < 0) { - return 0; - } - - WRITE_BIT(combo_state, kp_index, psc->state); - } - - return 0; -}; - -void unpair_combo_work_handler(struct k_work *work) { - for (int i = 0; i < KP_LEN; i++) { - if (!(combo_state & BIT(i))) { - LOG_DBG("Key position %d not held, skipping unpair combo", key_positions[i]); - return; - } - } - - zmk_ble_unpair_all(); -}; - -struct k_delayed_work unpair_combo_work; - -int zmk_ble_unpair_combo_init(struct device *_unused) { - k_delayed_work_init(&unpair_combo_work, unpair_combo_work_handler); - k_delayed_work_submit(&unpair_combo_work, K_SECONDS(2)); - - return 0; -}; - -ZMK_LISTENER(zmk_ble_unpair_combo, unpair_combo_listener); -ZMK_SUBSCRIPTION(zmk_ble_unpair_combo, position_state_changed); - -SYS_INIT(zmk_ble_unpair_combo_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); - -#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ diff --git a/docs/docs/assets/bond-clearing/corne.jpg b/docs/docs/assets/bond-clearing/corne.jpg deleted file mode 100644 index 1e070a2c..00000000 Binary files a/docs/docs/assets/bond-clearing/corne.jpg and /dev/null differ diff --git a/docs/docs/assets/bond-clearing/debug.log b/docs/docs/assets/bond-clearing/debug.log deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/docs/assets/bond-clearing/kyria.jpg b/docs/docs/assets/bond-clearing/kyria.jpg deleted file mode 100644 index 9fa22a07..00000000 Binary files a/docs/docs/assets/bond-clearing/kyria.jpg and /dev/null differ diff --git a/docs/docs/assets/bond-clearing/lily58.jpg b/docs/docs/assets/bond-clearing/lily58.jpg deleted file mode 100644 index 4087e7dc..00000000 Binary files a/docs/docs/assets/bond-clearing/lily58.jpg and /dev/null differ diff --git a/docs/docs/bond-reset.md b/docs/docs/bond-reset.md deleted file mode 100644 index a16b94d4..00000000 --- a/docs/docs/bond-reset.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -id: bond-reset -title: Reset BLE Connections (DEPRECATED) -sidebar_label: BLE Reset (DEPRECATED) ---- - -Known as a 'bond reset', each keyboard has a special key combination independent of the user defined key map which will -clear all wireless connection configurations. The keys must be held for 3 to 5 seconds after the device is -reset. - -:::warning -Currently, ZMK only supports a single BLE host. If you remove the keyboard from the host's bluetooth devices -list, you will need to clear the bonds. -::: - -## Split Keyboards - -Split keyboards will need to be cleared on both halves. For best results try to reset them at the same time. - -### Kyria - -![Kyria bond-reset combo](assets/bond-clearing/kyria.jpg) - -### Corne - -![Corne bond-reset combo](assets/bond-clearing/corne.jpg) - -### Lily58 - -![Lily58 bond-reset combo](assets/bond-clearing/lily58.jpg) diff --git a/docs/docs/user-setup.md b/docs/docs/user-setup.md index 990a8f6d..cdc82cab 100644 --- a/docs/docs/user-setup.md +++ b/docs/docs/user-setup.md @@ -194,7 +194,7 @@ storage device. Once the flash is complete, the controller should automatically ## Wirelessly Connecting Your Keyboard -Connecting your keyboard wirelessly is the same as adding other Bluetooth devides: press the reset button and scan for devices. However, pairing and bonding is still currently being worked on to increase relability and ease of use. In addition, users have in general reported that Bluetooth pairing with computers tends to be quite finnicky. Try out the connection with your tablet or phone first, as those devices seem to work much more consistently. See [BLE Reset](./bond-reset.md) for help on resetting your MCUs if you're experiencing connection issues. +Connecting your keyboard wirelessly is the same as adding other Bluetooth devides: press the reset button and scan for devices. However, pairing and bonding is still currently being worked on to increase relability and ease of use. In addition, users have in general reported that Bluetooth pairing with computers tends to be quite finnicky. Try out the connection with your tablet or phone first, as those devices seem to work much more consistently. ### Connecting Split Keyboard Halves