From 652bb6ce05254f8168f279396a50b92d7a2182c3 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Sat, 12 Sep 2020 23:48:44 -0400 Subject: [PATCH] feat(bluetooth): Add new settings_reset shield. * Easy to build board/image that will clear saved profile/bond information for a fresh start for keyboards. --- .github/workflows/build.yml | 1 + .../shields/settings_reset/Kconfig.defconfig | 10 ++++++++ .../shields/settings_reset/Kconfig.shield | 5 ++++ .../settings_reset/settings_reset.conf | 1 + .../settings_reset/settings_reset.keymap | 22 +++++++++++++++++ .../settings_reset/settings_reset.overlay | 24 +++++++++++++++++++ 6 files changed, 63 insertions(+) create mode 100644 app/boards/shields/settings_reset/Kconfig.defconfig create mode 100644 app/boards/shields/settings_reset/Kconfig.shield create mode 100644 app/boards/shields/settings_reset/settings_reset.conf create mode 100644 app/boards/shields/settings_reset/settings_reset.keymap create mode 100644 app/boards/shields/settings_reset/settings_reset.overlay diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8a711c1..02657c0c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,7 @@ jobs: - lily58_left - lily58_right - romac + - settings_reset include: - board: proton_c shield: clueboard_california diff --git a/app/boards/shields/settings_reset/Kconfig.defconfig b/app/boards/shields/settings_reset/Kconfig.defconfig new file mode 100644 index 00000000..6d050cb4 --- /dev/null +++ b/app/boards/shields/settings_reset/Kconfig.defconfig @@ -0,0 +1,10 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_SETTINGS_RESET + +config ZMK_KEYBOARD_NAME + default "SETTINGS RESET" + +endif + diff --git a/app/boards/shields/settings_reset/Kconfig.shield b/app/boards/shields/settings_reset/Kconfig.shield new file mode 100644 index 00000000..b5ce97f9 --- /dev/null +++ b/app/boards/shields/settings_reset/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_SETTINGS_RESET + def_bool $(shields_list_contains,settings_reset) diff --git a/app/boards/shields/settings_reset/settings_reset.conf b/app/boards/shields/settings_reset/settings_reset.conf new file mode 100644 index 00000000..8052a6cf --- /dev/null +++ b/app/boards/shields/settings_reset/settings_reset.conf @@ -0,0 +1 @@ +CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START=y diff --git a/app/boards/shields/settings_reset/settings_reset.keymap b/app/boards/shields/settings_reset/settings_reset.keymap new file mode 100644 index 00000000..05236445 --- /dev/null +++ b/app/boards/shields/settings_reset/settings_reset.keymap @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &reset + >; + }; + }; +}; + + diff --git a/app/boards/shields/settings_reset/settings_reset.overlay b/app/boards/shields/settings_reset/settings_reset.overlay new file mode 100644 index 00000000..a2b5799b --- /dev/null +++ b/app/boards/shields/settings_reset/settings_reset.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-direct"; + label = "KSCAN"; + + input-gpios + = <&pro_micro_d 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + ; + }; + +}; +