Browse Source

Merge branch 'main' into CrossR/Sofle

xmkb
CrossR 4 years ago
parent
commit
e593e971ec
  1. 2
      README.md
  2. 4
      app/Kconfig
  3. 6
      app/boards/arm/nice_nano/Kconfig
  4. 1
      app/boards/arm/nice_nano/Kconfig.board
  5. 2
      app/boards/arm/nice_nano/board.cmake
  6. 2
      app/boards/arm/proton_c/CMakeLists.txt
  7. 2
      app/boards/arm/proton_c/pinmux.c
  8. 3
      app/boards/shields/corne/corne.conf
  9. 3
      app/boards/shields/kyria/kyria.conf
  10. 2
      app/drivers/zephyr/ec11_trigger.c
  11. 24
      app/src/ble.c
  12. 2
      docs/blog/2020-05-24-wip.md
  13. 52
      docs/blog/2020-08-12-zmk-sotf-1.md
  14. 53
      docs/docs/dev-guide-new-shield.md
  15. 8
      docs/docs/feature/underglow.md
  16. 8
      docs/docusaurus.config.js

2
README.md

@ -11,4 +11,4 @@ Check out the website to learn more: https://zmkfirmware.dev/ @@ -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 feel free to add 👍 to the issue description of any requests to upvote the feature.

4
app/Kconfig

@ -106,6 +106,10 @@ if ZMK_SPLIT_BLE_ROLE_CENTRAL @@ -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

6
app/boards/arm/nice_nano/Kconfig

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
config BOARD_ENABLE_DCDC
bool "Enable DCDC mode"
select SOC_DCDC_NRF52X
default y
depends on BOARD_NICE_NANO

1
app/boards/arm/nice_nano/Kconfig.board

@ -6,3 +6,4 @@ @@ -6,3 +6,4 @@
config BOARD_NICE_NANO
bool "nice!nano"
depends on SOC_NRF52840_QIAA

2
app/boards/arm/nice_nano/board.cmake

@ -1,4 +1,4 @@ @@ -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)

2
app/boards/arm/proton_c/CMakeLists.txt

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
if(CONFIG_PINMUX)
zephyr_library()

2
app/boards/arm/proton_c/pinmux.c

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
/*
* Copyright (c) 2017 I-SENSE group of ICCS
*
* SPDX-License-Identifier: Apache-2.0
* SPDX-License-Identifier: MIT
*/
#include <kernel.h>

3
app/boards/shields/corne/corne.conf

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
# 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
# Uncomment the following line to enable the Corne OLED Display
# CONFIG_ZMK_DISPLAY=y

3
app/boards/shields/kyria/kyria.conf

@ -5,5 +5,6 @@ @@ -5,5 +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

2
app/drivers/zephyr/ec11_trigger.c

@ -1,7 +1,7 @@ @@ -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

24
app/src/ble.c

@ -31,11 +31,11 @@ static void connected(struct bt_conn *conn, u8_t err) @@ -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) @@ -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) @@ -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, @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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;
}

2
docs/blog/2020-05-24-wip.md

@ -5,7 +5,7 @@ author: Pete Johanson @@ -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.

52
docs/blog/2020-08-12-zmk-sotf-1.md

@ -0,0 +1,52 @@ @@ -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)).

53
docs/docs/dev-guide-new-shield.md

@ -81,9 +81,9 @@ this might look something like: @@ -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)>
;
};
};
@ -147,51 +147,38 @@ Some important things to note: @@ -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/<shield_name>/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/<shield_name>/<shield_name>.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 <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
/ {
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

8
docs/docs/feature/underglow.md

@ -21,10 +21,12 @@ Here you can see the RGB underglow feature in action using WS2812 LEDs. @@ -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 `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 to the 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 @@ -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 `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 to the LEDs you're using
CONFIG_WS2812_STRIP=y
```

8
docs/docusaurus.config.js

@ -7,6 +7,10 @@ module.exports = { @@ -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",
@ -101,12 +105,12 @@ module.exports = { @@ -101,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"),

Loading…
Cancel
Save