diff options
-rw-r--r-- | app/CMakeLists.txt | 4 | ||||
-rw-r--r-- | app/Kconfig | 12 | ||||
-rw-r--r-- | app/boards/arm/nrfmicro/pinmux.c | 4 | ||||
-rw-r--r-- | app/boards/shields/corne/corne_left.conf | 1 | ||||
-rw-r--r-- | app/boards/shields/corne/corne_right.conf | 1 | ||||
-rw-r--r-- | app/boards/shields/kyria/kyria_left.conf | 3 | ||||
-rw-r--r-- | app/boards/shields/kyria/kyria_right.conf | 1 | ||||
-rw-r--r-- | app/boards/shields/lily58/lily58_left.conf | 1 | ||||
-rw-r--r-- | app/boards/shields/lily58/lily58_right.conf | 1 | ||||
-rw-r--r-- | app/cmake/zmk_config.cmake | 1 | ||||
-rw-r--r-- | app/src/ble_unpair_combo.c | 7 | ||||
-rw-r--r-- | docs/docs/dev-setup.md | 27 |
12 files changed, 28 insertions, 35 deletions
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 054f84a..9fce3b6 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -1,4 +1,3 @@ -# Find Zephyr. This also loads Zephyr's build system. cmake_minimum_required(VERSION 3.13.1) set(CONFIG_APPLICATION_DEFINED_SYSCALL true) @@ -15,6 +14,7 @@ list(APPEND SYSCALL_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/drivers/zephyr) include(cmake/zmk_config.cmake) +# Find Zephyr. This also loads Zephyr's build system. find_package(Zephyr REQUIRED HINTS ../zephyr) project(zmk) @@ -44,7 +44,7 @@ target_sources(app PRIVATE src/behaviors/behavior_none.c) target_sources(app PRIVATE src/behaviors/behavior_sensor_rotate_key_press.c) target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/behaviors/behavior_rgb_underglow.c) target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/ble.c) -target_sources_ifdef(CONFIG_ZMK_BLE_UNPAIR_COMBO app PRIVATE src/ble_unpair_combo.c) +target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/ble_unpair_combo.c) target_sources_ifdef(CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL app PRIVATE src/split_listener.c) target_sources_ifdef(CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL app PRIVATE src/split/bluetooth/service.c) target_sources_ifdef(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL app PRIVATE src/split/bluetooth/central.c) diff --git a/app/Kconfig b/app/Kconfig index 416c985..877fce4 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -41,16 +41,10 @@ menuconfig ZMK_BLE select BT_GATT_DIS select BT_GATT_BAS select SETTINGS - select BT_SETTINGS + # select BT_SETTINGS if ZMK_BLE -config ZMK_BLE_UNPAIR_COMBO - bool "Enable BT unpair combo" - help - Adds a magic key combo that can be held on startup to remove all paired devices - default n - config ZMK_BLE_INIT_PRIORITY int "Init Priority" default 50 @@ -199,6 +193,10 @@ source "subsys/logging/Kconfig.template.log_config" rsource "boards/Kconfig" rsource "boards/shields/*/Kconfig.defconfig" +rsource "boards/shields/*/Kconfig.shield" + +osource "$(ZMK_CONFIG)/boards/shields/*/Kconfig.defconfig" +osource "$(ZMK_CONFIG)/boards/shields/*/Kconfig.shield" source "Kconfig.zephyr" diff --git a/app/boards/arm/nrfmicro/pinmux.c b/app/boards/arm/nrfmicro/pinmux.c index 803d20d..c02ca92 100644 --- a/app/boards/arm/nrfmicro/pinmux.c +++ b/app/boards/arm/nrfmicro/pinmux.c @@ -17,7 +17,7 @@ static int pinmux_nrfmicro_init(struct device *port) struct device *p1 = device_get_binding("GPIO_1"); -#if defined(BOARD_NRFMICRO_13) +#if CONFIG_BOARD_NRFMICRO_13 struct device *p0 = device_get_binding("GPIO_0"); // enable EXT_VCC (use 0 for nRFMicro 1.3, use 1 for nRFMicro 1.1) gpio_pin_configure(p1, 9, GPIO_OUTPUT); @@ -34,4 +34,4 @@ static int pinmux_nrfmicro_init(struct device *port) return 0; } -SYS_INIT(pinmux_nrfmicro_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);
\ No newline at end of file +SYS_INIT(pinmux_nrfmicro_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); diff --git a/app/boards/shields/corne/corne_left.conf b/app/boards/shields/corne/corne_left.conf index 338fa59..1e028a7 100644 --- a/app/boards/shields/corne/corne_left.conf +++ b/app/boards/shields/corne/corne_left.conf @@ -1,3 +1,2 @@ CONFIG_ZMK_SPLIT=y CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y -CONFIG_ZMK_BLE_UNPAIR_COMBO=y
\ No newline at end of file diff --git a/app/boards/shields/corne/corne_right.conf b/app/boards/shields/corne/corne_right.conf index be344c4..990cf7c 100644 --- a/app/boards/shields/corne/corne_right.conf +++ b/app/boards/shields/corne/corne_right.conf @@ -1,3 +1,2 @@ CONFIG_ZMK_SPLIT=y CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL=y -CONFIG_ZMK_BLE_UNPAIR_COMBO=y
\ No newline at end of file diff --git a/app/boards/shields/kyria/kyria_left.conf b/app/boards/shields/kyria/kyria_left.conf index 338fa59..e51dee4 100644 --- a/app/boards/shields/kyria/kyria_left.conf +++ b/app/boards/shields/kyria/kyria_left.conf @@ -1,3 +1,2 @@ CONFIG_ZMK_SPLIT=y -CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y -CONFIG_ZMK_BLE_UNPAIR_COMBO=y
\ No newline at end of file +CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y
\ No newline at end of file diff --git a/app/boards/shields/kyria/kyria_right.conf b/app/boards/shields/kyria/kyria_right.conf index be344c4..990cf7c 100644 --- a/app/boards/shields/kyria/kyria_right.conf +++ b/app/boards/shields/kyria/kyria_right.conf @@ -1,3 +1,2 @@ CONFIG_ZMK_SPLIT=y CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL=y -CONFIG_ZMK_BLE_UNPAIR_COMBO=y
\ No newline at end of file diff --git a/app/boards/shields/lily58/lily58_left.conf b/app/boards/shields/lily58/lily58_left.conf index 338fa59..1e028a7 100644 --- a/app/boards/shields/lily58/lily58_left.conf +++ b/app/boards/shields/lily58/lily58_left.conf @@ -1,3 +1,2 @@ CONFIG_ZMK_SPLIT=y CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y -CONFIG_ZMK_BLE_UNPAIR_COMBO=y
\ No newline at end of file diff --git a/app/boards/shields/lily58/lily58_right.conf b/app/boards/shields/lily58/lily58_right.conf index cf16779..990cf7c 100644 --- a/app/boards/shields/lily58/lily58_right.conf +++ b/app/boards/shields/lily58/lily58_right.conf @@ -1,3 +1,2 @@ CONFIG_ZMK_SPLIT=y CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL=y -CONFIG_ZMK_BLE_UNPAIR_COMBO=y diff --git a/app/cmake/zmk_config.cmake b/app/cmake/zmk_config.cmake index 518c3c3..017dd11 100644 --- a/app/cmake/zmk_config.cmake +++ b/app/cmake/zmk_config.cmake @@ -44,6 +44,7 @@ endif() set(CACHED_ZMK_CONFIG ${ZMK_CONFIG} CACHE STRING "Selected user ZMK config") if (ZMK_CONFIG) + set(ENV{ZMK_CONFIG} "${ZMK_CONFIG}") if(EXISTS ${ZMK_CONFIG}/boards) message(STATUS "Adding ZMK config directory as board root: ${ZMK_CONFIG}") list(APPEND BOARD_ROOT ${ZMK_CONFIG}) diff --git a/app/src/ble_unpair_combo.c b/app/src/ble_unpair_combo.c index a33a8e2..82fa834 100644 --- a/app/src/ble_unpair_combo.c +++ b/app/src/ble_unpair_combo.c @@ -7,10 +7,11 @@ #include <device.h> #include <init.h> -#include <logging/log.h> - #define DT_DRV_COMPAT zmk_bt_unpair_combo +#if DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) + +#include <logging/log.h> LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); #include <zmk/ble.h> @@ -78,3 +79,5 @@ 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/dev-setup.md b/docs/docs/dev-setup.md index 5cceb73..6e893b3 100644 --- a/docs/docs/dev-setup.md +++ b/docs/docs/dev-setup.md @@ -180,7 +180,7 @@ brew install cmake ninja python3 ccache dtc git wget ### West Build Command -`west` is the [Zephyr™ meta-tool](https://docs.zephyrproject.org/latest/guides/west/index.html) used to configure and build Zephyr™ applications. +`west` is the [Zephyr™ meta-tool](https://docs.zephyrproject.org/2.3.0/guides/west/index.html) used to configure and build Zephyr™ applications. West can be installed by using the `pip` python package manager. @@ -223,7 +223,7 @@ The installation will prompt with several questions about installation location, <TabItem value="raspberryos"> Because Raspberry OS (Raspbian) runs on the same architecture (but different ABI) as the keyboard MCUs, -the operating system's installed [cross compilers](https://docs.zephyrproject.org/latest/getting_started/toolchain_other_x_compilers.html) can be used to target the different ABI. +the operating system's installed [cross compilers](https://docs.zephyrproject.org/2.3.0/getting_started/toolchain_other_x_compilers.html) can be used to target the different ABI. First, the cross compiler should be installed: @@ -259,23 +259,20 @@ The installation will prompt with several questions about installation location, #### GNU ARM Embedded -Since the Zephyr™ SDK is not available for Windows, we recommending following the steps to install the [GNU ARM Embedded](https://docs.zephyrproject.org/latest/getting_started/toolchain_3rd_party_x_compilers.html#gnu-arm-embedded). +Since the Zephyr™ SDK is not available for Windows, we recommending following the steps to install the [GNU ARM Embedded](https://docs.zephyrproject.org/2.3.0/getting_started/toolchain_3rd_party_x_compilers.html#gnu-arm-embedded). </TabItem> <TabItem value="mac"> -#### Zephyr™ ARM SDK +#### GNU ARM Embedded -To build firmwares for the ARM architecture (all supported MCUs/keyboards at this point), you'll need to install the Zephyr™ ARM SDK to your system: +Since the Zephyr™ SDK is not available for macOS, we recommending following the steps to install the [GNU ARM Embedded](https://docs.zephyrproject.org/2.3.0/getting_started/toolchain_3rd_party_x_compilers.html#gnu-arm-embedded). -``` -export ZSDK_VERSION=0.11.2 -wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/zephyr-toolchain-arm-${ZSDK_VERSION}-setup.run" && \ - sh "zephyr-toolchain-arm-${ZSDK_VERSION}-setup.run" --quiet -- -d ~/.local/zephyr-sdk-${ZSDK_VERSION} && \ - rm "zephyr-toolchain-arm-\${ZSDK_VERSION}-setup.run" -``` +:::warning Security Controls Workaround -The installation will prompt with several questions about installation location, and creating a default `~/.zephyrrc` for you with various variables. The defaults should normally work as expected. +Please be sure to read the [additional setup instructions](https://docs.zephyrproject.org/2.3.0/getting_started/installation_mac.html#mac-gatekeeper) needed to address security controls found in macOS 10.15 Catalina and newer + +::: </TabItem> </OsTabs> @@ -342,7 +339,7 @@ pip3 install --user -r zephyr/scripts/requirements-base.txt ### Environment Variables By default, the Zephyr™ SDK will create a file named `~/.zephyrrc` with the correct environment variables to build ZMK. -We suggest two main [options](https://docs.zephyrproject.org/latest/guides/env_vars.html?highlight=zephyrrc) for how to load those settings. +We suggest two main [options](https://docs.zephyrproject.org/2.3.0/guides/env_vars.html?highlight=zephyrrc) for how to load those settings. #### Per Shell @@ -442,7 +439,7 @@ an onboard MCU, or one that uses a MCU board addon. ### Keyboard (Shield) + MCU Board -ZMK treats keyboards that take a MCU addon board as [shields](https://docs.zephyrproject.org/latest/guides/porting/shields.html), and treats the smaller MCU board as the true [board](https://docs.zephyrproject.org/latest/guides/porting/board_porting.html) +ZMK treats keyboards that take a MCU addon board as [shields](https://docs.zephyrproject.org/2.3.0/guides/porting/shields.html), and treats the smaller MCU board as the true [board](https://docs.zephyrproject.org/2.3.0/guides/porting/board_porting.html) Given the following: @@ -458,7 +455,7 @@ west build -b proton_c -- -DSHIELD=kyria_left -DKEYMAP=default ### Keyboard With Onboard MCU -Keyboards with onboard MCU chips are simply treated as the [board](https://docs.zephyrproject.org/latest/guides/porting/board_porting.html) as far as Zephyr™ is concerned. +Keyboards with onboard MCU chips are simply treated as the [board](https://docs.zephyrproject.org/2.3.0/guides/porting/board_porting.html) as far as Zephyr™ is concerned. Given the following: |