From f1f77ad32ae5358dff54181e7bd41c6cdff22810 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 11 Aug 2020 13:07:15 -0400 Subject: [PATCH 01/14] Add a note about upvoting feature requests. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34854f25..26ab37e8 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,4 @@ Check out the website to learn more: https://zmkfirmware.dev/ You can also come join our [ZMK Discord Server](https://zmkfirmware.dev/community/discord/invite) -To review planned features, check out the [enhancement label](https://github.com/zmkfirmware/zmk/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement) in GitHub. +To review planned features, check out the [enhancement label](https://github.com/zmkfirmware/zmk/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement) in GitHub. Please free to add 👍 to the issue desciprtion of any requests to upvote the feature. From af5e936b89d5586f52597fb82422cfcfa1e2abbf Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 11 Aug 2020 14:37:49 -0400 Subject: [PATCH 02/14] Typo fixes. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 26ab37e8..93f4e831 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,4 @@ Check out the website to learn more: https://zmkfirmware.dev/ You can also come join our [ZMK Discord Server](https://zmkfirmware.dev/community/discord/invite) -To review planned features, check out the [enhancement label](https://github.com/zmkfirmware/zmk/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement) in GitHub. Please free to add 👍 to the issue desciprtion of any requests to upvote the feature. +To review planned features, check out the [enhancement label](https://github.com/zmkfirmware/zmk/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement) in GitHub. Please feel free to add 👍 to the issue description of any requests to upvote the feature. From 78059bbbdb2d53957718f38f37b20216baa51566 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 11 Aug 2020 14:49:43 -0400 Subject: [PATCH 03/14] Fix up some incorrect license headers. --- app/boards/arm/nice_nano/board.cmake | 2 +- app/boards/arm/proton_c/CMakeLists.txt | 2 +- app/boards/arm/proton_c/pinmux.c | 2 +- app/drivers/zephyr/ec11_trigger.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/boards/arm/nice_nano/board.cmake b/app/boards/arm/nice_nano/board.cmake index 12a1d93b..fa847d50 100644 --- a/app/boards/arm/nice_nano/board.cmake +++ b/app/boards/arm/nice_nano/board.cmake @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) diff --git a/app/boards/arm/proton_c/CMakeLists.txt b/app/boards/arm/proton_c/CMakeLists.txt index d1b8108c..940af1fe 100644 --- a/app/boards/arm/proton_c/CMakeLists.txt +++ b/app/boards/arm/proton_c/CMakeLists.txt @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT if(CONFIG_PINMUX) zephyr_library() diff --git a/app/boards/arm/proton_c/pinmux.c b/app/boards/arm/proton_c/pinmux.c index 09f3a349..a6aaae0a 100644 --- a/app/boards/arm/proton_c/pinmux.c +++ b/app/boards/arm/proton_c/pinmux.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2017 I-SENSE group of ICCS * - * SPDX-License-Identifier: Apache-2.0 + * SPDX-License-Identifier: MIT */ #include diff --git a/app/drivers/zephyr/ec11_trigger.c b/app/drivers/zephyr/ec11_trigger.c index 55acf45e..709d1fbf 100644 --- a/app/drivers/zephyr/ec11_trigger.c +++ b/app/drivers/zephyr/ec11_trigger.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2016 Intel Corporation * - * SPDX-License-Identifier: Apache-2.0 + * SPDX-License-Identifier: MIT */ #define DT_DRV_COMPAT alps_ec11 From a6ef1cddecda77e0e374a59fb76266df6d00f2bd Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 11 Aug 2020 16:55:36 -0400 Subject: [PATCH 04/14] Add analytics. --- docs/docusaurus.config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 44acd69c..2c3622f4 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -7,6 +7,10 @@ module.exports = { organizationName: "zmkfirmware", // Usually your GitHub org/user name. projectName: "zmk", // Usually your repo name. themeConfig: { + googleAnalytics: { + trackingID: "UA-145201102-2", + anonymizeIP: true, + }, // sidebarCollapsible: false, navbar: { title: "ZMK Firmware", From 0624c6c54a3292571229727b3e19088bb155e482 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Wed, 12 Aug 2020 10:20:51 -0400 Subject: [PATCH 05/14] State Of The Firmware #1. --- docs/blog/2020-05-24-wip.md | 2 +- docs/blog/2020-08-12-zmk-sotf-1.md | 52 ++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 docs/blog/2020-08-12-zmk-sotf-1.md diff --git a/docs/blog/2020-05-24-wip.md b/docs/blog/2020-05-24-wip.md index 2ec2956e..eaf2b795 100644 --- a/docs/blog/2020-05-24-wip.md +++ b/docs/blog/2020-05-24-wip.md @@ -5,7 +5,7 @@ author: Pete Johanson author_title: Project Creator author_url: https://gitlab.com/petejohanson author_image_url: https://www.gravatar.com/avatar/2001ceff7e9dc753cf96fcb2e6f41110 -tags: [keyboards, firmeware, oss, ble] +tags: [keyboards, firmware, oss, ble] --- This blog is a work-in-progress as I work on basic docs + blog on this nascent keyboard firmware. diff --git a/docs/blog/2020-08-12-zmk-sotf-1.md b/docs/blog/2020-08-12-zmk-sotf-1.md new file mode 100644 index 00000000..2b695350 --- /dev/null +++ b/docs/blog/2020-08-12-zmk-sotf-1.md @@ -0,0 +1,52 @@ +--- +title: ZMK State Of The Firmware \#1 +author: Pete Johanson +author_title: Project Creator +author_url: https://gitlab.com/petejohanson +author_image_url: https://www.gravatar.com/avatar/2001ceff7e9dc753cf96fcb2e6f41110 +tags: [SOTF, keyboards, firmware, oss, ble] +--- + +Welcome to the first ZMK "State Of The Firmware"! + +With interest and Discord activity growing, it seemed important to lay out the progress made recently, current major bugs/showstoppers, and planned next steps. + +## Recent Activity + +There's been lots of various activity in ZMK land! + +- [Nicell](https://github.com/Nicell) (nice!nano creator) contributed initial [RGB Underglow](/docs/feature/underglow) ([#64](https://github.com/zmkfirmware/zmk/pull/64)) support to ZMK. +- Tons of [documentation](/docs) work. +- Refactoring ([#73](https://github.com/zmkfirmware/zmk/pull/73), [#74](https://github.com/zmkfirmware/zmk/pull/74)) of [keymaps](/docs/feature/keymaps) to make them simpler for users. +- Mod-Tap Behavior (docs coming!) is much improved ([#69](https://github.com/zmkfirmware/zmk/pull/69)) and usable now. +- An initial [`setup.sh`](http://localhost:3000/docs/user-setup#user-config-setup-script) script was created, allowing users to quickly bootstrap a "user config" setup and push it to GitHub, where GitHub Actions will build the firmware for you. +- Corne shield ([#80](https://github.com/zmkfirmware/zmk/pull/80)) shield definition was added. +- Initial [encoder](/docs/feature/encoders) support ([#61](https://github.com/zmkfirmware/zmk/pull/61)) was added. + +## Bugs and Showstoppers + +Despite the flurry of activity, there are still some serious bugs and show stoppers that potential ZMK users should be aware of: + +- [Bluetooth Related](https://github.com/zmkfirmware/zmk/issues/58) - There are several key bugs and fixes needed, including one complete show stopper: + - Fully working split wireless is not working. In particular, both split halves can properly pair, but once they do so, pairing with the _central_ host will not work. Workaround: You can currently have both halves pair, and use USB on the central side (Left side right now for Kyria, Corne, Lily58) and receive HID events over USB. + - BT bond information is not currently stored to the devices, so after powering off or restarting your device, users need to re-pair +- USB - There is one important USB related bug which is a showstopper: + - The Zephyr USB stack does not have a built in queue for endpoint data being written. As a result, HID events sent by ZMK are sometimes [dropped, or lost](https://github.com/zmkfirmware/zmk/issues/84). + +## Next Steps + +There's plenty of places to go next! To help keep folks in the loop for what's next, I've created a [Core Functionality](https://github.com/zmkfirmware/zmk/projects/1) project/kanban board in GitHub, where users should be able to get some visibility into items being focused on. + +Of course, at the top of that list currently is the above bugs/showstoppers, and then from there, I hope to: + +- Work on power management. +- Improve our documentation on various aspects of the system, mostly around: + - End user documentation for understanding how to use ZMK, better installation docs, etc. + - Developer focused documentation, so interested contributors can start building out more behaviors and ZMK functionality. +- Implement true "hold" detection, useful for several behaviors such as Mod-Tap and Layer-Tap. +- Hopefully acquire a proper and official USB Product ID for use for the project. +- Fun things that come up along the way! + +## Thanks! + +A big thanks for everyone who has shown interest in the project, tested things, asked questions, and contributed PRs ([Nicell](https://github.com/Nicell), [CrossR](https://github.com/CrossR), [careyk007](https://github.com/careyk007)). From c3b4525d2574bcd0cd03d91b069bd090c01292da Mon Sep 17 00:00:00 2001 From: Cody McGinnis Date: Thu, 13 Aug 2020 00:19:59 -0400 Subject: [PATCH 06/14] Fix edit url links for the website. --- docs/docusaurus.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 2c3622f4..64f9a454 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -105,12 +105,12 @@ module.exports = { homePageId: "intro", sidebarPath: require.resolve("./sidebars.js"), // Please change this to your repo. - editUrl: "https://githlab.com/zmkproject/zmk/edit/main/docs/", + editUrl: "https://github.com/zmkfirmware/zmk/edit/main/docs/", }, blog: { showReadingTime: true, // Please change this to your repo. - editUrl: "https://gitlab.com/zmkproject/zmk/edit/main/docs/blog/", + editUrl: "https://github.com/zmkfirmware/zmk/edit/main/docs/", }, theme: { customCss: require.resolve("./src/css/custom.css"), From 8b61beb2bbc62f754db670ad77266f84edde041d Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Fri, 14 Aug 2020 16:44:13 -0400 Subject: [PATCH 07/14] Bump max paired connections to 2 for central. --- app/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Kconfig b/app/Kconfig index 4086955a..be5a1e4a 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -106,6 +106,10 @@ if ZMK_SPLIT_BLE_ROLE_CENTRAL config BT_MAX_CONN default 5 +config BT_MAX_PAIRED + # Bump this everywhere once we support switching active connections! + default 2 + endif config ZMK_SPLIT_BLE_ROLE_PERIPHERAL From 7e8a07e693431adfb64d12262b3c7614920c042c Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Fri, 14 Aug 2020 16:45:05 -0400 Subject: [PATCH 08/14] Remove use of printk. --- app/src/ble.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/src/ble.c b/app/src/ble.c index 7d986d71..488491c2 100644 --- a/app/src/ble.c +++ b/app/src/ble.c @@ -31,11 +31,11 @@ static void connected(struct bt_conn *conn, u8_t err) if (err) { - printk("Failed to connect to %s (%u)\n", addr, err); + LOG_WRN("Failed to connect to %s (%u)", log_strdup(addr), err); return; } - printk("Connected %s\n", addr); + LOG_DBG("Connected %s", log_strdup(addr)); bt_conn_le_param_update(conn, BT_LE_CONN_PARAM(0x0006, 0x000c, 30, 400)); @@ -45,7 +45,7 @@ static void connected(struct bt_conn *conn, u8_t err) if (bt_conn_set_security(conn, BT_SECURITY_L2)) { - printk("Failed to set security\n"); + LOG_ERR("Failed to set security"); } } @@ -55,7 +55,7 @@ static void disconnected(struct bt_conn *conn, u8_t reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Disconnected from %s (reason 0x%02x)\n", addr, reason); + LOG_DBG("Disconnected from %s (reason 0x%02x)", log_strdup(addr), reason); } static void security_changed(struct bt_conn *conn, bt_security_t level, @@ -67,11 +67,11 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { - printk("Security changed: %s level %u\n", addr, level); + LOG_DBG("Security changed: %s level %u", log_strdup(addr), level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, + LOG_ERR("Security failed: %s level %u err %d", log_strdup(addr), level, err); } } @@ -107,7 +107,7 @@ static void auth_passkey_display(struct bt_conn *conn, unsigned int passkey) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Passkey for %s: %06u\n", addr, passkey); + LOG_DBG("Passkey for %s: %06u", log_strdup(addr), passkey); } #ifdef CONFIG_ZMK_BLE_PASSKEY_ENTRY @@ -118,7 +118,7 @@ static void auth_passkey_entry(struct bt_conn *conn) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Passkey entry requested for %s\n", addr); + LOG_DBG("Passkey entry requested for %s", log_strdup(addr)); auth_passkey_entry_conn = bt_conn_ref(conn); } @@ -138,7 +138,7 @@ static void auth_cancel(struct bt_conn *conn) passkey_digit = 0; - printk("Pairing cancelled: %s\n", addr); + LOG_DBG("Pairing cancelled: %s", log_strdup(addr)); } static struct bt_conn_auth_cb zmk_ble_auth_cb_display = { @@ -169,14 +169,14 @@ static void zmk_ble_ready(int err) LOG_DBG("ready? %d", err); if (err) { - printk("Bluetooth init failed (err %d)\n", err); + LOG_ERR("Bluetooth init failed (err %d)", err); return; } err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, zmk_ble_ad, ARRAY_SIZE(zmk_ble_ad), NULL, 0); if (err) { - printk("Advertising failed to start (err %d)\n", err); + LOG_ERR("Advertising failed to start (err %d)", err); return; } } @@ -187,7 +187,7 @@ static int zmk_ble_init(struct device *_arg) if (err) { - printk("BLUETOOTH FAILED"); + LOG_ERR("BLUETOOTH FAILED (%d)", err); return err; } From aa4ae90fb7cd7d7e295f9f5d4af8ad63d9bc9715 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 14 Aug 2020 21:31:18 -0500 Subject: [PATCH 09/14] Add missing configuration values for RGB underglow --- app/boards/shields/corne/corne.conf | 1 + app/boards/shields/kyria/kyria.conf | 1 + docs/docs/feature/underglow.md | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/boards/shields/corne/corne.conf b/app/boards/shields/corne/corne.conf index c8e3c00c..e96bf5ac 100644 --- a/app/boards/shields/corne/corne.conf +++ b/app/boards/shields/corne/corne.conf @@ -1,5 +1,6 @@ # Uncomment the following line to enable the Corne RGB Underglow # ZMK_RGB_UNDERGLOW=y +# CONFIG_WS2812_STRIP=y # Uncomment the following line to enable the Corne OLED Display # CONFIG_ZMK_DISPLAY=y diff --git a/app/boards/shields/kyria/kyria.conf b/app/boards/shields/kyria/kyria.conf index fa98d1cd..20aa8c20 100644 --- a/app/boards/shields/kyria/kyria.conf +++ b/app/boards/shields/kyria/kyria.conf @@ -7,3 +7,4 @@ # Uncomment the following line to enable RGB underglow # CONFIG_ZMK_RGB_UNDERGLOW=y +# CONFIG_WS2812_STRIP=y diff --git a/docs/docs/feature/underglow.md b/docs/docs/feature/underglow.md index 780845af..4be752fc 100644 --- a/docs/docs/feature/underglow.md +++ b/docs/docs/feature/underglow.md @@ -21,10 +21,12 @@ Here you can see the RGB underglow feature in action using WS2812 LEDs. ## Enabling RGB Underglow -To enable RGB underglow on your board or shield, simply enable the `ZMK_RGB_UNDERGLOW` configuration value in the `.conf` file of your user config directory as such: +To enable RGB underglow on your board or shield, simply enable the `ZMK_RGB_UNDERGLOW` and `CONFIG_X_STRIP` configuration values in the `.conf` file of your user config directory as such: ``` CONFIG_ZMK_RGB_UNDERGLOW=y +# Use the STRIP config specific tot he LEDs you're using +CONFIG_WS2812_STRIP=y ``` If your board or shield does not have RGB underglow configured, refer to [Adding RGB Underglow to a Board](#adding-rgb-underglow-to-a-board). @@ -114,8 +116,10 @@ Once you have your `led_strip` properly defined you need to add it to the root d }; ``` -Finally you need to enable the `ZMK_RGB_UNDERGLOW` configuration value in the `.conf` file of your board (or set a default in the `Kconfig.defconfig`): +Finally you need to enable the `ZMK_RGB_UNDERGLOW` and `CONFIG_X_STRIP` STRIP configuration values in the `.conf` file of your board (or set a default in the `Kconfig.defconfig`): ``` CONFIG_ZMK_RGB_UNDERGLOW=y +# Use the STRIP config specific tot he LEDs you're using +CONFIG_WS2812_STRIP=y ``` From a03b3ab68c5a81dc7c98749241dbfe80e5f1b09b Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 14 Aug 2020 21:33:33 -0500 Subject: [PATCH 10/14] Fix grammar --- app/boards/shields/corne/corne.conf | 2 +- app/boards/shields/kyria/kyria.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/boards/shields/corne/corne.conf b/app/boards/shields/corne/corne.conf index e96bf5ac..b79385bd 100644 --- a/app/boards/shields/corne/corne.conf +++ b/app/boards/shields/corne/corne.conf @@ -1,4 +1,4 @@ -# Uncomment the following line to enable the Corne RGB Underglow +# Uncomment the following lines to enable the Corne RGB Underglow # ZMK_RGB_UNDERGLOW=y # CONFIG_WS2812_STRIP=y diff --git a/app/boards/shields/kyria/kyria.conf b/app/boards/shields/kyria/kyria.conf index 20aa8c20..7a0b5b6c 100644 --- a/app/boards/shields/kyria/kyria.conf +++ b/app/boards/shields/kyria/kyria.conf @@ -5,6 +5,6 @@ # Uncomment the following line to enable the Kyria OLED Display # CONFIG_ZMK_DISPLAY=y -# Uncomment the following line to enable RGB underglow +# Uncomment the following lines to enable RGB underglow # CONFIG_ZMK_RGB_UNDERGLOW=y # CONFIG_WS2812_STRIP=y From 2863f150063bc4a31cc819efe973b59b45a10d10 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 14 Aug 2020 21:36:11 -0500 Subject: [PATCH 11/14] Fix docs typos --- docs/docs/feature/underglow.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/feature/underglow.md b/docs/docs/feature/underglow.md index 4be752fc..c6517ced 100644 --- a/docs/docs/feature/underglow.md +++ b/docs/docs/feature/underglow.md @@ -21,11 +21,11 @@ Here you can see the RGB underglow feature in action using WS2812 LEDs. ## Enabling RGB Underglow -To enable RGB underglow on your board or shield, simply enable the `ZMK_RGB_UNDERGLOW` and `CONFIG_X_STRIP` configuration values in the `.conf` file of your user config directory as such: +To enable RGB underglow on your board or shield, simply enable the `ZMK_RGB_UNDERGLOW` and `X_STRIP` configuration values in the `.conf` file of your user config directory as such: ``` CONFIG_ZMK_RGB_UNDERGLOW=y -# Use the STRIP config specific tot he LEDs you're using +# Use the STRIP config specific to the LEDs you're using CONFIG_WS2812_STRIP=y ``` @@ -116,10 +116,10 @@ Once you have your `led_strip` properly defined you need to add it to the root d }; ``` -Finally you need to enable the `ZMK_RGB_UNDERGLOW` and `CONFIG_X_STRIP` STRIP configuration values in the `.conf` file of your board (or set a default in the `Kconfig.defconfig`): +Finally you need to enable the `ZMK_RGB_UNDERGLOW` and `X_STRIP` configuration values in the `.conf` file of your board (or set a default in the `Kconfig.defconfig`): ``` CONFIG_ZMK_RGB_UNDERGLOW=y -# Use the STRIP config specific tot he LEDs you're using +# Use the STRIP config specific to the LEDs you're using CONFIG_WS2812_STRIP=y ``` From 4acfa8d7ef2009ce966f6e58719d44abb193f659 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Fri, 14 Aug 2020 23:26:03 -0400 Subject: [PATCH 12/14] Add DCDC setting for nano. --- app/boards/arm/nice_nano/Kconfig | 6 ++++++ app/boards/arm/nice_nano/Kconfig.board | 1 + 2 files changed, 7 insertions(+) create mode 100644 app/boards/arm/nice_nano/Kconfig diff --git a/app/boards/arm/nice_nano/Kconfig b/app/boards/arm/nice_nano/Kconfig new file mode 100644 index 00000000..a1904253 --- /dev/null +++ b/app/boards/arm/nice_nano/Kconfig @@ -0,0 +1,6 @@ + +config BOARD_ENABLE_DCDC + bool "Enable DCDC mode" + select SOC_DCDC_NRF52X + default y + depends on BOARD_NICE_NANO diff --git a/app/boards/arm/nice_nano/Kconfig.board b/app/boards/arm/nice_nano/Kconfig.board index 60ee58b5..4fd394f4 100644 --- a/app/boards/arm/nice_nano/Kconfig.board +++ b/app/boards/arm/nice_nano/Kconfig.board @@ -6,3 +6,4 @@ config BOARD_NICE_NANO bool "nice!nano" depends on SOC_NRF52840_QIAA + From 7e1942867b0c7c19f6bd78e6f8a15227fbfc323b Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Sat, 15 Aug 2020 20:20:19 -0400 Subject: [PATCH 13/14] Doc fixes for keymaps. --- docs/docs/dev-guide-new-shield.md | 47 +++++++++++-------------------- 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/docs/docs/dev-guide-new-shield.md b/docs/docs/dev-guide-new-shield.md index 11198065..963a723c 100644 --- a/docs/docs/dev-guide-new-shield.md +++ b/docs/docs/dev-guide-new-shield.md @@ -147,51 +147,38 @@ Some important things to note: ## Default Keymap -Each keyboard should provide an OOTB default keymap to be used when building the firmware, which can be overridden and customized by user configs. For "shield keyboards", this should be placed in the `app/boards/shields//keymap/keymap.overlay` file. The keymap is configured as an additional devicetree overlay that includes the following: +Each keyboard should provide an OOTB default keymap to be used when building the firmware, which can be overridden and customized by user configs. For "shield keyboards", this should be placed in the `app/boards/shields//.keymap` file. The keymap is configured as an additional devicetree overlay that includes the following: -- A node with `compatible="zmk,layers"` where each child node is a layer with a `bindings` array that binds each key position to a given behavior (e.g. key press, momentarily layer, etc). -- A node with `compatible="zmk,keymap"` that references the layers with a `layers` phandle-array property. -- A chosen node named `zmk,keymap` that references the defined keymap. +- A node with `compatible="zmk,keymap"` where each child node is a layer with a `bindings` array that binds each key position to a given behavior (e.g. key press, momentarily layer, etc). -Here is an example simple keymap for the nice60, with only one layer: +Here is an example simple keymap for the Kyria, with only one layer: ``` #include #include / { - chosen { - zmk,keymap = &keymap0; - }; - - keymap0: keymap { + keymap { compatible = "zmk,keymap"; - label ="Default nice!60 Keymap"; - layers = <&default>; - }; - layers { - compatible = "zmk,layers"; - - default: layer_0 { - label = "DEFAULT"; -// ------------------------------------------------------------------------------------------ -// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP | -// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | "|" | -// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | -// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | -// | CTL | WIN | ALT | SPACE | ALT | WIN | MENU | CTL | -// ------------------------------------------------------------------------------------------ + default_layer { +// --------------------------------------------------------------------------------------------------------------------------------- +// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | +// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | +// | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | L SHIFT | L SHIFT | N | M | , | . | / | CTRL | +// | GUI | DEL | RET | SPACE | ESC | | RET | SPACE | TAB | BSPC | R-ALT | bindings = < - &kp ESC &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_0 &kp MINUS &kp EQL &kp BKSP - &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH - &kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SCLN &kp QUOT &kp RET - &kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RSFT - &kp LCTL &kp LGUI &kp LALT &kp SPC &kp RALT &kp RGUI &kp GUI &kp RCTL + &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH + &kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SCLN &kp QUOT + &kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp LSFT &kp LSFT &kp LSFT &kp LSFT &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RCTL + &kp LGUI &kp DEL &kp RET &kp SPC &kp ESC &kp RET &kp SPC &kp TAB &kp BKSP &kp RALT >; + + sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD &inc_dec_kp PGUP PGDN>; }; }; }; + ``` :::note From ee5900686bdb921beccf87566cb1ba4977059f99 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Sat, 15 Aug 2020 21:13:50 -0400 Subject: [PATCH 14/14] Fix the active/pull down flags for the example. --- docs/docs/dev-guide-new-shield.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/dev-guide-new-shield.md b/docs/docs/dev-guide-new-shield.md index 963a723c..8556623d 100644 --- a/docs/docs/dev-guide-new-shield.md +++ b/docs/docs/dev-guide-new-shield.md @@ -81,9 +81,9 @@ this might look something like: ; row-gpios - = <&pro_micro_a 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> - , <&pro_micro_a 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> - , <&pro_micro_a 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + = <&pro_micro_a 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_a 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_a 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> ; }; };