Merge https://github.com/zmkfirmware/zmk into main
This commit is contained in:
commit
a8d37b3b57
127 changed files with 8914 additions and 25391 deletions
|
@ -1,4 +1,4 @@
|
|||
FROM zmkfirmware/zmk-dev-arm:2.4
|
||||
FROM zmkfirmware/zmk-dev-arm:2.5
|
||||
|
||||
COPY .bashrc tmp
|
||||
RUN mv /tmp/.bashrc ~/.bashrc
|
||||
|
|
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
|
@ -14,12 +14,13 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: zmkfirmware/zmk-build-arm:2.4
|
||||
image: zmkfirmware/zmk-build-arm:2.5
|
||||
strategy:
|
||||
matrix:
|
||||
board:
|
||||
- bluemicro840_v1
|
||||
- nice_nano
|
||||
- nice_nano_v2
|
||||
- nrfmicro_13
|
||||
- proton_c
|
||||
shield:
|
||||
|
@ -69,11 +70,11 @@ jobs:
|
|||
- board: planck_rev6
|
||||
- board: proton_c
|
||||
shield: clueboard_california
|
||||
- board: nice_nano
|
||||
- board: nice_nano_v2
|
||||
shield: kyria_left
|
||||
cmake-args: -DCONFIG_ZMK_DISPLAY=y
|
||||
skip-archive: true
|
||||
- board: nice_nano
|
||||
- board: nice_nano_v2
|
||||
shield: kyria_right
|
||||
cmake-args: -DCONFIG_ZMK_DISPLAY=y
|
||||
skip-archive: true
|
||||
|
|
2
.github/workflows/clang-format-lint.yml
vendored
2
.github/workflows/clang-format-lint.yml
vendored
|
@ -23,7 +23,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: DoozyX/clang-format-lint-action@v0.11
|
||||
- uses: DoozyX/clang-format-lint-action@v0.12
|
||||
with:
|
||||
source: "./app"
|
||||
extensions: "h,c"
|
||||
|
|
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -16,7 +16,7 @@ jobs:
|
|||
integration_test:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: zmkfirmware/zmk-build-arm:2.4
|
||||
image: zmkfirmware/zmk-build-arm:2.5
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
|
|
@ -60,7 +60,7 @@ representative at an online or offline event.
|
|||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
conduct@zmkfirmware.dev.
|
||||
conduct@zmk.dev.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
|
|
|
@ -7,7 +7,7 @@ you have any questions, please come join us on the
|
|||
## Code of Conduct
|
||||
|
||||
All community members are expected to abide by the [Code of Conduct][code-of-conduct].
|
||||
For any and all conduct inquiries or concerns, please contact conduct@zmkfirmware.dev.
|
||||
For any and all conduct inquiries or concerns, please contact conduct@zmk.dev.
|
||||
|
||||
[code-of-conduct]: https://github.com/zmkfirmware/zmk/blob/main/CODE_OF_CONDUCT.md
|
||||
|
||||
|
@ -35,8 +35,8 @@ ZMK project.
|
|||
|
||||
### Before Submitting a Report
|
||||
|
||||
- Review the [Frequently Asked Questions](https://zmkfirmware.dev/docs/faq).
|
||||
- Check the [Troubleshooting Guide](https://zmkfirmware.dev/docs/troubleshooting) for answers.
|
||||
- Review the [Frequently Asked Questions](https://zmk.dev/docs/faq).
|
||||
- Check the [Troubleshooting Guide](https://zmk.dev/docs/troubleshooting) for answers.
|
||||
- Search the [open issues](https://github.com/zmkfirmware/zmk/issues) for an existing report that
|
||||
matches your problem.
|
||||
|
||||
|
@ -47,10 +47,10 @@ To open a report:
|
|||
- Head to https://github.com/zmkfirmware/zmk/issues/new
|
||||
- Provide an accurate summary of the issue in the title.
|
||||
- Provide as much detail as you can about the issue including:
|
||||
- What [board/shield](https://zmkfirmware.dev/docs/faq#what-is-a-board) you are using.
|
||||
- What [board/shield](https://zmk.dev/docs/faq#what-is-a-board) you are using.
|
||||
- A link to the user repository, if you used it to build your firmware.
|
||||
- Exact steps to reproduce the problem.
|
||||
- Any relevant screenshots or [logs](https://zmkfirmware.dev/docs/dev-guide-usb-logging)
|
||||
- Any relevant screenshots or [logs](https://zmk.dev/docs/dev-guide-usb-logging)
|
||||
|
||||
## Testing
|
||||
|
||||
|
@ -91,7 +91,7 @@ You can setup git to run prettier automatically when you commit by installing th
|
|||
### Development Setup
|
||||
|
||||
To get your development environment setup going, start at the
|
||||
[basic setup](https://zmkfirmware.dev/docs/dev-setup) docs, and make sure you can build and flash
|
||||
[basic setup](https://zmk.dev/docs/dev-setup) docs, and make sure you can build and flash
|
||||
your own locally built firmware.
|
||||
|
||||
### Formatting
|
||||
|
@ -124,4 +124,4 @@ When opening a pull request with your changes, please:
|
|||
- Requested testing by reviewers or testers.
|
||||
- Screenshots or logs that support understanding the change.
|
||||
|
||||
[discord-invite]: https://zmkfirmware.dev/community/discord/invite
|
||||
[discord-invite]: https://zmk.dev/community/discord/invite
|
||||
|
|
10
README.md
10
README.md
|
@ -1,13 +1,13 @@
|
|||
# Zephyr™ Mechanical Keyboard (ZMK) Firmware
|
||||
|
||||
[](https://zmkfirmware.dev/community/discord/invite)
|
||||
[](https://zmk.dev/community/discord/invite)
|
||||
[](https://github.com/zmkfirmware/zmk/actions)
|
||||
[](CODE_OF_CONDUCT.md)
|
||||
|
||||
[ZMK Firmware](https://zmkfirmware.dev/) is an open source (MIT) keyboard firmware built on the [Zephyr™ Project](https://www.zephyrproject.org/) Real Time Operating System (RTOS). ZMK's goal is to provide a modern, wireless, and powerful firmware free of licensing issues.
|
||||
[ZMK Firmware](https://zmk.dev/) is an open source (MIT) keyboard firmware built on the [Zephyr™ Project](https://www.zephyrproject.org/) Real Time Operating System (RTOS). ZMK's goal is to provide a modern, wireless, and powerful firmware free of licensing issues.
|
||||
|
||||
Check out the website to learn more: https://zmkfirmware.dev/
|
||||
Check out the website to learn more: https://zmk.dev/
|
||||
|
||||
You can also come join our [ZMK Discord Server](https://zmkfirmware.dev/community/discord/invite)
|
||||
You can also come join our [ZMK Discord Server](https://zmk.dev/community/discord/invite)
|
||||
|
||||
To review features, check out the [feature overview](https://zmkfirmware.dev/docs/). ZMK is under active development, and new features are listed with 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.
|
||||
To review features, check out the [feature overview](https://zmk.dev/docs/). ZMK is under active development, and new features are listed with 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.
|
||||
|
|
10
app/Kconfig
10
app/Kconfig
|
@ -263,11 +263,8 @@ config ZMK_SLEEP
|
|||
|
||||
if ZMK_SLEEP
|
||||
|
||||
config SYS_POWER_DEEP_SLEEP_STATES
|
||||
default y
|
||||
|
||||
choice SYS_PM_POLICY
|
||||
default SYS_PM_POLICY_APP
|
||||
default PM_POLICY_APP
|
||||
endchoice
|
||||
|
||||
config DEVICE_POWER_MANAGEMENT
|
||||
|
@ -422,6 +419,11 @@ config ZMK_WPM
|
|||
config SENSOR
|
||||
default y
|
||||
|
||||
choice CBPRINTF_IMPLEMENTATION
|
||||
default CBPRINTF_NANO
|
||||
|
||||
endchoice
|
||||
|
||||
module = ZMK
|
||||
module-str = zmk
|
||||
source "subsys/logging/Kconfig.template.log_config"
|
||||
|
|
|
@ -11,6 +11,9 @@ CONFIG_FPU=y
|
|||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
# Enable pinmux
|
||||
CONFIG_PINMUX=y
|
||||
|
||||
# Needed to reduce this to size that will fit on F072
|
||||
CONFIG_HEAP_MEM_POOL_SIZE=1024
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
leds {
|
||||
compatible = "gpio-leds";
|
||||
blue_led: led_0 {
|
||||
gpios = <&gpio0 42 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
|
||||
label = "Blue LED";
|
||||
};
|
||||
};
|
||||
|
@ -29,6 +29,7 @@
|
|||
ext-power {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
label = "EXT_POWER";
|
||||
init-delay-ms = <20>;
|
||||
control-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
|
|
8
app/boards/arm/nice60/CMakeLists.txt
Normal file
8
app/boards/arm/nice60/CMakeLists.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/../tools/uf2/utils/uf2conv.py
|
||||
-c
|
||||
-b 0x1000
|
||||
-f 0xADA52840
|
||||
-o ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.uf2
|
||||
${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin
|
||||
)
|
8
app/boards/arm/nice60/Kconfig
Normal file
8
app/boards/arm/nice60/Kconfig
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Copyright (c) 2021 Nick Winans
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config BOARD_ENABLE_DCDC
|
||||
bool "Enable DCDC mode"
|
||||
select SOC_DCDC_NRF52X
|
||||
default y
|
||||
depends on BOARD_NICE60
|
6
app/boards/arm/nice60/Kconfig.board
Normal file
6
app/boards/arm/nice60/Kconfig.board
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Copyright (c) 2021 Nick Winans
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config BOARD_NICE60
|
||||
bool "nice!60"
|
||||
depends on SOC_NRF52840_QIAA
|
31
app/boards/arm/nice60/Kconfig.defconfig
Normal file
31
app/boards/arm/nice60/Kconfig.defconfig
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Copyright (c) 2021 Nick Winans
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if BOARD_NICE60
|
||||
|
||||
config ZMK_KEYBOARD_NAME
|
||||
default "nice!60"
|
||||
|
||||
if USB
|
||||
|
||||
config USB_NRFX
|
||||
default y
|
||||
|
||||
config USB_DEVICE_STACK
|
||||
default y
|
||||
|
||||
endif # USB
|
||||
|
||||
config BT_CTLR
|
||||
default BT
|
||||
|
||||
config ZMK_BLE
|
||||
default y
|
||||
|
||||
config ZMK_USB
|
||||
default y
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_NICE60
|
9
app/boards/arm/nice60/README.md
Normal file
9
app/boards/arm/nice60/README.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
# nice!60
|
||||

|
||||
|
||||
The nice!60 is a hotswap 60% made by Nice Keyboards. https://nicekeyboards.com/nice-60
|
||||
|
||||
## Building nice!60 ZMK firmware
|
||||
```
|
||||
west build -p -b nice60
|
||||
```
|
7
app/boards/arm/nice60/board.cmake
Normal file
7
app/boards/arm/nice60/board.cmake
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Copyright (c) 2021 Nick Winans
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set(OPENOCD_NRF5_SUBFAMILY nrf52)
|
||||
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
|
||||
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake)
|
172
app/boards/arm/nice60/nice60.dts
Normal file
172
app/boards/arm/nice60/nice60.dts
Normal file
|
@ -0,0 +1,172 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Nick Winans
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include <nordic/nrf52840_qiaa.dtsi>
|
||||
#include <dt-bindings/zmk/matrix_transform.h>
|
||||
|
||||
/ {
|
||||
model = "nice!60";
|
||||
compatible = "nice,60";
|
||||
|
||||
chosen {
|
||||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zmk,kscan = &kscan0;
|
||||
zmk,matrix_transform = &default_transform;
|
||||
zmk,underglow = &led_strip;
|
||||
};
|
||||
|
||||
default_transform: keymap_transform_0 {
|
||||
compatible = "zmk,matrix-transform";
|
||||
columns = <14>;
|
||||
rows = <5>;
|
||||
map = <
|
||||
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13)
|
||||
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13)
|
||||
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) RC(2,10) RC(2,11) RC(2,13)
|
||||
RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,13)
|
||||
RC(4,0) RC(4,1) RC(4,2) RC(4,5) RC(4,9) RC(4,10) RC(4,11) RC(4,13)
|
||||
>;
|
||||
};
|
||||
|
||||
kscan0: kscan {
|
||||
compatible = "zmk,kscan-gpio-matrix";
|
||||
label = "KSCAN";
|
||||
|
||||
diode-direction = "col2row";
|
||||
row-gpios
|
||||
= <&gpio1 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio1 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio1 12 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio1 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio1 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
;
|
||||
col-gpios
|
||||
= <&gpio1 15 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 29 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 31 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 30 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 28 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 2 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 3 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 3 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 7 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 4 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 6 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 5 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 1 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 2 GPIO_ACTIVE_HIGH>
|
||||
;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
blue_led: led_0 {
|
||||
gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
|
||||
label = "Blue LED";
|
||||
};
|
||||
};
|
||||
|
||||
ext-power {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
label = "EXT_POWER";
|
||||
control-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
vbatt {
|
||||
compatible = "zmk,battery-voltage-divider";
|
||||
label = "BATTERY";
|
||||
io-channels = <&adc 2>;
|
||||
output-ohms = <2000000>;
|
||||
full-ohms = <(2000000 + 806000)>;
|
||||
};
|
||||
};
|
||||
|
||||
&adc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpiote {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
/* Cannot be used together with i2c0. */
|
||||
status = "okay";
|
||||
sck-pin = <12>;
|
||||
mosi-pin = <27>;
|
||||
miso-pin = <13>;
|
||||
|
||||
led_strip: ws2812@0 {
|
||||
compatible = "worldsemi,ws2812-spi";
|
||||
label = "WS2812";
|
||||
|
||||
/* SPI */
|
||||
reg = <0>; /* ignored, but necessary for SPI bindings */
|
||||
spi-max-frequency = <4000000>;
|
||||
|
||||
/* WS2812 */
|
||||
chain-length = <12>; /* LED strip length */
|
||||
spi-one-frame = <0x70>;
|
||||
spi-zero-frame = <0x40>;
|
||||
};
|
||||
};
|
||||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
/*
|
||||
* For more information, see:
|
||||
* http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
|
||||
*/
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
sd_partition: partition@0 {
|
||||
label = "mbr";
|
||||
reg = <0x00000000 0x00001000>;
|
||||
};
|
||||
|
||||
code_partition: partition@1000 {
|
||||
label = "code_partition";
|
||||
reg = <0x00001000 0x000d3000>;
|
||||
};
|
||||
|
||||
/*
|
||||
* The flash starting at 0x000d4000 and ending at
|
||||
* 0x000f3fff is reserved for use by the application.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Storage partition will be used by FCB/LittleFS/NVS
|
||||
* if enabled.
|
||||
*/
|
||||
storage_partition: partition@d4000 {
|
||||
label = "storage";
|
||||
reg = <0x000d4000 0x00020000>;
|
||||
};
|
||||
|
||||
boot_partition: partition@f4000 {
|
||||
label = "adafruit_boot";
|
||||
reg = <0x000f4000 0x0000c000>;
|
||||
};
|
||||
};
|
||||
};
|
50
app/boards/arm/nice60/nice60.keymap
Normal file
50
app/boards/arm/nice60/nice60.keymap
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Nick Winans
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <dt-bindings/zmk/rgb.h>
|
||||
#include <dt-bindings/zmk/bt.h>
|
||||
|
||||
/ {
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
|
||||
default_layer {
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// | 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 | MO(1) | CTL |
|
||||
// ------------------------------------------------------------------------------------------
|
||||
bindings = <
|
||||
&gresc &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC
|
||||
&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 SEMI &kp SQT &kp RET
|
||||
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
|
||||
&kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &kp RGUI &mo 1 &kp RCTRL
|
||||
>;
|
||||
};
|
||||
|
||||
rgb_layer {
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// | BT CLR | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | EFFECT REV |
|
||||
// | BT 1 | | UP | | HUEUP | SATUP | BRIUP | SPDUP | | | | | | |
|
||||
// | BT 2 | LT | DN | RT | HUEDN | SATDN | BRIDN | SPDDN | | | | | EFFECT FORW |
|
||||
// | BT 3 | | | | | | | | | | | |
|
||||
// | BT 4 | | | TOG RGB | PRT SCR | | | DEL |
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bindings = <
|
||||
&bt BT_CLR &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &rgb_ug RGB_EFR
|
||||
&bt BT_SEL 0 &trans &kp UP &trans &rgb_ug RGB_HUI &rgb_ug RGB_SAI &rgb_ug RGB_BRI &rgb_ug RGB_SPI &trans &trans &trans &trans &trans &trans
|
||||
&bt BT_SEL 1 &kp LEFT &kp DOWN &kp RIGHT &rgb_ug RGB_HUD &rgb_ug RGB_SAD &rgb_ug RGB_BRD &rgb_ug RGB_SPD &trans &trans &trans &trans &rgb_ug RGB_EFF
|
||||
&bt BT_SEL 2 &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
||||
&bt BT_SEL 3 &trans &trans &rgb_ug RGB_TOG &kp PSCRN &trans &trans &kp DEL
|
||||
>;
|
||||
};
|
||||
};
|
||||
};
|
14
app/boards/arm/nice60/nice60.yaml
Normal file
14
app/boards/arm/nice60/nice60.yaml
Normal file
|
@ -0,0 +1,14 @@
|
|||
identifier: nice60
|
||||
name: nice!60
|
||||
type: mcu
|
||||
arch: arm
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
supported:
|
||||
- adc
|
||||
- usb_device
|
||||
- ble
|
||||
- ieee802154
|
||||
- pwm
|
||||
- watchdog
|
27
app/boards/arm/nice60/nice60_defconfig
Normal file
27
app/boards/arm/nice60/nice60_defconfig
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Copyright (c) 2021 Nick Winans
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
CONFIG_SOC_SERIES_NRF52X=y
|
||||
CONFIG_SOC_NRF52840_QIAA=y
|
||||
CONFIG_BOARD_NICE60=y
|
||||
|
||||
# Enable MPU
|
||||
CONFIG_ARM_MPU=y
|
||||
|
||||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
CONFIG_USE_DT_CODE_PARTITION=y
|
||||
|
||||
CONFIG_MPU_ALLOW_FLASH_WRITE=y
|
||||
CONFIG_NVS=y
|
||||
CONFIG_SETTINGS_NVS=y
|
||||
CONFIG_FLASH=y
|
||||
CONFIG_FLASH_PAGE_LAYOUT=y
|
||||
CONFIG_FLASH_MAP=y
|
||||
|
||||
CONFIG_ZMK_RGB_UNDERGLOW=y
|
||||
CONFIG_WS2812_STRIP=y
|
||||
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=160
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=3
|
|
@ -4,4 +4,4 @@ config BOARD_ENABLE_DCDC
|
|||
bool "Enable DCDC mode"
|
||||
select SOC_DCDC_NRF52X
|
||||
default y
|
||||
depends on BOARD_NICE_NANO
|
||||
depends on (BOARD_NICE_NANO || BOARD_NICE_NANO_V2)
|
||||
|
|
|
@ -7,3 +7,7 @@ config BOARD_NICE_NANO
|
|||
bool "nice!nano"
|
||||
depends on SOC_NRF52840_QIAA
|
||||
|
||||
config BOARD_NICE_NANO_V2
|
||||
bool "nice!nano v2"
|
||||
depends on SOC_NRF52840_QIAA
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Copyright (c) 2020 Pete Johanson
|
||||
# Copyright (c) 2021 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if BOARD_NICE_NANO
|
||||
if BOARD_NICE_NANO || BOARD_NICE_NANO_V2
|
||||
|
||||
config BOARD
|
||||
default "nice_nano"
|
||||
|
@ -28,4 +28,4 @@ config ZMK_USB
|
|||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_NICE_NANO
|
||||
endif # BOARD_NICE_NANO || BOARD_NICE_NANO_V2
|
||||
|
|
|
@ -1,31 +1,13 @@
|
|||
/*
|
||||
* Copyright (c) 2020 Pete Johanson
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include <nordic/nrf52840_qiaa.dtsi>
|
||||
#include "arduino_pro_micro_pins.dtsi"
|
||||
#include "nice_nano.dtsi"
|
||||
|
||||
/ {
|
||||
model = "nice!nano";
|
||||
compatible = "nice,nano";
|
||||
|
||||
chosen {
|
||||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
blue_led: led_0 {
|
||||
gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
|
||||
label = "Blue LED";
|
||||
};
|
||||
};
|
||||
|
||||
ext-power {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
label = "EXT_POWER";
|
||||
|
@ -40,76 +22,3 @@
|
|||
full-ohms = <(2000000 + 806000)>;
|
||||
};
|
||||
};
|
||||
|
||||
&adc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpiote {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
compatible = "nordic,nrf-twi";
|
||||
sda-pin = <17>;
|
||||
scl-pin = <20>;
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
compatible = "nordic,nrf-uarte";
|
||||
tx-pin = <6>;
|
||||
rx-pin = <8>;
|
||||
};
|
||||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
&flash0 {
|
||||
/*
|
||||
* For more information, see:
|
||||
* http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
|
||||
*/
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
sd_partition: partition@0 {
|
||||
label = "softdevice";
|
||||
reg = <0x00000000 0x00026000>;
|
||||
};
|
||||
code_partition: partition@26000 {
|
||||
label = "code_partition";
|
||||
reg = <0x00026000 0x000c6000>;
|
||||
};
|
||||
|
||||
/*
|
||||
* The flash starting at 0x000ec000 and ending at
|
||||
* 0x000f3fff is reserved for use by the application.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Storage partition will be used by FCB/LittleFS/NVS
|
||||
* if enabled.
|
||||
*/
|
||||
storage_partition: partition@ec000 {
|
||||
label = "storage";
|
||||
reg = <0x000ec000 0x00008000>;
|
||||
};
|
||||
|
||||
boot_partition: partition@f4000 {
|
||||
label = "adafruit_boot";
|
||||
reg = <0x000f4000 0x0000c000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
100
app/boards/arm/nice_nano/nice_nano.dtsi
Normal file
100
app/boards/arm/nice_nano/nice_nano.dtsi
Normal file
|
@ -0,0 +1,100 @@
|
|||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <nordic/nrf52840_qiaa.dtsi>
|
||||
#include "arduino_pro_micro_pins.dtsi"
|
||||
|
||||
/ {
|
||||
model = "nice!nano";
|
||||
compatible = "nice,nano";
|
||||
|
||||
chosen {
|
||||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
blue_led: led_0 {
|
||||
gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
|
||||
label = "Blue LED";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&adc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpiote {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
compatible = "nordic,nrf-twi";
|
||||
sda-pin = <17>;
|
||||
scl-pin = <20>;
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
compatible = "nordic,nrf-uarte";
|
||||
tx-pin = <6>;
|
||||
rx-pin = <8>;
|
||||
};
|
||||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
&flash0 {
|
||||
/*
|
||||
* For more information, see:
|
||||
* http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
|
||||
*/
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
sd_partition: partition@0 {
|
||||
label = "softdevice";
|
||||
reg = <0x00000000 0x00026000>;
|
||||
};
|
||||
code_partition: partition@26000 {
|
||||
label = "code_partition";
|
||||
reg = <0x00026000 0x000c6000>;
|
||||
};
|
||||
|
||||
/*
|
||||
* The flash starting at 0x000ec000 and ending at
|
||||
* 0x000f3fff is reserved for use by the application.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Storage partition will be used by FCB/LittleFS/NVS
|
||||
* if enabled.
|
||||
*/
|
||||
storage_partition: partition@ec000 {
|
||||
label = "storage";
|
||||
reg = <0x000ec000 0x00008000>;
|
||||
};
|
||||
|
||||
boot_partition: partition@f4000 {
|
||||
label = "adafruit_boot";
|
||||
reg = <0x000f4000 0x0000c000>;
|
||||
};
|
||||
};
|
||||
};
|
26
app/boards/arm/nice_nano/nice_nano_v2.dts
Normal file
26
app/boards/arm/nice_nano/nice_nano_v2.dts
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include "nice_nano.dtsi"
|
||||
|
||||
/ {
|
||||
ext-power {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
label = "EXT_POWER";
|
||||
control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
|
||||
init-delay-ms = <10>;
|
||||
};
|
||||
|
||||
vbatt {
|
||||
compatible = "zmk,battery-voltage-divider";
|
||||
label = "BATTERY";
|
||||
io-channels = <&adc (0x0D - 1)>;
|
||||
// Multiply ADC result by 5
|
||||
full-ohms = <5>;
|
||||
output-ohms = <1>;
|
||||
};
|
||||
};
|
15
app/boards/arm/nice_nano/nice_nano_v2.yaml
Normal file
15
app/boards/arm/nice_nano/nice_nano_v2.yaml
Normal file
|
@ -0,0 +1,15 @@
|
|||
identifier: nice_nano_v2
|
||||
name: nice!nano v2
|
||||
type: mcu
|
||||
arch: arm
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- adc
|
||||
- usb_device
|
||||
- ble
|
||||
- ieee802154
|
||||
- pwm
|
||||
- watchdog
|
20
app/boards/arm/nice_nano/nice_nano_v2_defconfig
Normal file
20
app/boards/arm/nice_nano/nice_nano_v2_defconfig
Normal file
|
@ -0,0 +1,20 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
CONFIG_SOC_SERIES_NRF52X=y
|
||||
CONFIG_SOC_NRF52840_QIAA=y
|
||||
CONFIG_BOARD_NICE_NANO_V2=y
|
||||
|
||||
# Enable MPU
|
||||
CONFIG_ARM_MPU=y
|
||||
|
||||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
CONFIG_USE_DT_CODE_PARTITION=y
|
||||
|
||||
CONFIG_MPU_ALLOW_FLASH_WRITE=y
|
||||
CONFIG_NVS=y
|
||||
CONFIG_SETTINGS_NVS=y
|
||||
CONFIG_FLASH=y
|
||||
CONFIG_FLASH_PAGE_LAYOUT=y
|
||||
CONFIG_FLASH_MAP=y
|
|
@ -1,7 +0,0 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if(CONFIG_PINMUX)
|
||||
zephyr_library()
|
||||
zephyr_library_sources(pinmux.c)
|
||||
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
|
||||
endif()
|
|
@ -48,5 +48,5 @@
|
|||
};
|
||||
|
||||
pro_micro_i2c: &i2c1 {};
|
||||
pro_micro_spi: &spi1 {};
|
||||
pro_micro_spi: &spi2 {};
|
||||
pro_micro_serial: &usart1 {};
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2017 I-SENSE group of ICCS
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <kernel.h>
|
||||
#include <device.h>
|
||||
#include <init.h>
|
||||
#include <drivers/pinmux.h>
|
||||
#include <sys/sys_io.h>
|
||||
|
||||
#include <pinmux/stm32/pinmux_stm32.h>
|
||||
|
||||
/* pin assignments for STM32F3DISCOVERY board */
|
||||
static const struct pin_config pinconf[] = {
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usart1), okay) && CONFIG_SERIAL
|
||||
{STM32_PIN_PC4, STM32F3_PINMUX_FUNC_PC4_USART1_TX},
|
||||
{STM32_PIN_PC5, STM32F3_PINMUX_FUNC_PC5_USART1_RX},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usart2), okay) && CONFIG_SERIAL
|
||||
{STM32_PIN_PA2, STM32F3_PINMUX_FUNC_PA2_USART2_TX},
|
||||
{STM32_PIN_PA3, STM32F3_PINMUX_FUNC_PA3_USART2_RX},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C
|
||||
{STM32_PIN_PB6, STM32F3_PINMUX_FUNC_PB6_I2C1_SCL},
|
||||
{STM32_PIN_PB7, STM32F3_PINMUX_FUNC_PB7_I2C1_SDA},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C
|
||||
{STM32_PIN_PA9, STM32F3_PINMUX_FUNC_PA9_I2C2_SCL},
|
||||
{STM32_PIN_PA10, STM32F3_PINMUX_FUNC_PA10_I2C2_SDA},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI
|
||||
#ifdef CONFIG_SPI_STM32_USE_HW_SS
|
||||
{STM32_PIN_PA4, STM32F3_PINMUX_FUNC_PA4_SPI1_NSS},
|
||||
#endif /* CONFIG_SPI_STM32_USE_HW_SS */
|
||||
{STM32_PIN_PA5, STM32F3_PINMUX_FUNC_PA5_SPI1_SCK},
|
||||
{STM32_PIN_PA6, STM32F3_PINMUX_FUNC_PA6_SPI1_MISO},
|
||||
{STM32_PIN_PA7, STM32F3_PINMUX_FUNC_PA7_SPI1_MOSI},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI
|
||||
#ifdef CONFIG_SPI_STM32_USE_HW_SS
|
||||
{STM32_PIN_PB12, STM32F3_PINMUX_FUNC_PB12_SPI2_NSS},
|
||||
#endif /* CONFIG_SPI_STM32_USE_HW_SS */
|
||||
{STM32_PIN_PB13, STM32F3_PINMUX_FUNC_PB13_SPI2_SCK},
|
||||
{STM32_PIN_PB14, STM32F3_PINMUX_FUNC_PB14_SPI2_MISO},
|
||||
{STM32_PIN_PB15, STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI},
|
||||
#endif
|
||||
#ifdef CONFIG_USB_DC_STM32
|
||||
{STM32_PIN_PA11, STM32F3_PINMUX_FUNC_PA11_USB_DM},
|
||||
{STM32_PIN_PA12, STM32F3_PINMUX_FUNC_PA12_USB_DP},
|
||||
#endif /* CONFIG_USB_DC_STM32 */
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(can1), okay) && CONFIG_CAN
|
||||
{STM32_PIN_PD0, STM32F3_PINMUX_FUNC_PD0_CAN1_RX},
|
||||
{STM32_PIN_PD1, STM32F3_PINMUX_FUNC_PD1_CAN1_TX},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port) {
|
||||
ARG_UNUSED(port);
|
||||
|
||||
stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1, CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
/dts-v1/;
|
||||
#include <st/f3/stm32f303Xc.dtsi>
|
||||
#include <st/f3/stm32f303c(b-c)tx-pinctrl.dtsi>
|
||||
#include "arduino_pro_micro_pins.dtsi"
|
||||
|
||||
/ {
|
||||
|
@ -26,6 +27,18 @@
|
|||
};
|
||||
};
|
||||
|
||||
&usart1 {
|
||||
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
|
||||
};
|
||||
|
||||
&spi2 {
|
||||
pinctrl-0 = <&spi2_sck_pb13 &spi2_miso_pb14 &spi2_mosi_pb15>;
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
|
||||
};
|
||||
|
||||
&usb {
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -6,3 +6,5 @@ CONFIG_ZMK_BLE=n
|
|||
CONFIG_LOG=y
|
||||
CONFIG_LOG_BACKEND_SHOW_COLOR=n
|
||||
CONFIG_ZMK_LOG_LEVEL_DBG=y
|
||||
CONFIG_DEBUG=y
|
||||
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
if SHIELD_CRADIO_LEFT
|
||||
|
||||
config ZMK_KEYBOARD_NAME
|
||||
default "cradio left"
|
||||
default "Cradio"
|
||||
|
||||
config ZMK_SPLIT_BLE_ROLE_CENTRAL
|
||||
default y
|
||||
|
@ -14,11 +14,11 @@ endif
|
|||
if SHIELD_CRADIO_RIGHT
|
||||
|
||||
config ZMK_KEYBOARD_NAME
|
||||
default "cradio right"
|
||||
default "Cradio_Right"
|
||||
|
||||
endif
|
||||
|
||||
if SHIELD_CRADIO_LEFT || SHIELD_CRADIO_RIGHT
|
||||
if SHIELD_CRADIO_RIGHT || SHIELD_CRADIO_LEFT
|
||||
|
||||
config ZMK_SPLIT
|
||||
default y
|
||||
|
|
1
app/boards/shields/cradio/README.md
Normal file
1
app/boards/shields/cradio/README.md
Normal file
|
@ -0,0 +1 @@
|
|||
Cradio is a firmware for a few 34 key keyboards, including Cradio, Hypergolic and Sweep.
|
0
app/boards/shields/cradio/cradio.conf
Normal file
0
app/boards/shields/cradio/cradio.conf
Normal file
|
@ -7,9 +7,10 @@
|
|||
#include <dt-bindings/zmk/matrix_transform.h>
|
||||
|
||||
/ {
|
||||
|
||||
chosen {
|
||||
zmk,kscan = &kscan0;
|
||||
//zmk,matrix_transform = &default_transform;
|
||||
zmk,matrix_transform = &default_transform;
|
||||
};
|
||||
|
||||
default_transform: keymap_transform_0 {
|
||||
|
@ -22,6 +23,7 @@
|
|||
RC(0,10) RC(0,11) RC(0,12) RC(0,13) RC(0,14) RC(0,31) RC(0,30) RC(0,29) RC(0,28) RC(0,27)
|
||||
RC(0,15) RC(0,16) RC(0,33) RC(0,32)
|
||||
>;
|
||||
};
|
||||
|
||||
kscan0: kscan {
|
||||
compatible = "zmk,kscan-gpio-direct";
|
||||
|
@ -46,5 +48,5 @@
|
|||
, <&pro_micro_d 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -9,33 +9,92 @@
|
|||
#include <dt-bindings/zmk/bt.h>
|
||||
|
||||
|
||||
&mt {
|
||||
// flavor = "tap-preferred";
|
||||
// tapping_term_ms = <200>;
|
||||
};
|
||||
|
||||
/ {
|
||||
|
||||
combos {
|
||||
compatible = "zmk,combos";
|
||||
combo_esc {
|
||||
timeout-ms = <50>;
|
||||
key-positions = <0 1>;
|
||||
bindings = <&kp ESC>;
|
||||
};
|
||||
|
||||
combo_tab {
|
||||
timeout-ms = <50>;
|
||||
key-positions = <10 11>;
|
||||
bindings = <&kp TAB>;
|
||||
};
|
||||
|
||||
combo_ralt {
|
||||
timeout-ms = <50>;
|
||||
key-positions = <17 16>;
|
||||
bindings = <&kp RALT>;
|
||||
};
|
||||
|
||||
combo_lalt {
|
||||
timeout-ms = <50>;
|
||||
key-positions = <11 12>;
|
||||
bindings = <&kp LALT>;
|
||||
};
|
||||
|
||||
combo_lgui {
|
||||
timeout-ms = <50>;
|
||||
key-positions = <12 13>;
|
||||
bindings = <&kp LGUI>;
|
||||
};
|
||||
|
||||
|
||||
combo_rgui {
|
||||
timeout-ms = <50>;
|
||||
key-positions = <17 18>;
|
||||
bindings = <&kp RGUI>;
|
||||
};
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
|
||||
default_layer {
|
||||
bindings = <
|
||||
&kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P
|
||||
&kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI
|
||||
&kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH
|
||||
&mo 1 &kp LCTRL &kp SPACE &mo 2
|
||||
>;
|
||||
};
|
||||
upper_layer {
|
||||
bindings = <
|
||||
&kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0
|
||||
&bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &kp H &kp J &kp K &kp L &kp SEMI
|
||||
&kp LSHFT &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
||||
&mo 1 &kp LCTRL &kp SPACE &mo 2
|
||||
&kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp QUOT
|
||||
&mt LSFT Z &kp X &kp C &kp V &kp B &kp N &kp M &kp CMMA &kp DOT &mt LSFT RET
|
||||
&mo 1 &kp LCTL &kp SPC &mo 2
|
||||
>;
|
||||
};
|
||||
|
||||
lower_layer {
|
||||
left_layer {
|
||||
bindings = <
|
||||
&kp EXCL &kp AT &kp HASH &kp DOLLAR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR
|
||||
&trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp PIPE
|
||||
&trans &trans &trans &trans &trans &trans &trans &trans &kp BSLH &kp TILDE
|
||||
&mo 1 &kp LCTRL &kp SPACE &mo 2
|
||||
&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 TAB &kp LC(S) &kp DQT &kp PIPE2 &kp HASH &kp MINUS &kp EQL &kp LBKT &kp RBKT &kp DEL
|
||||
&kp ESC &kp TILDE &kp NON_US_BSLH &kp NON_US_HASH &kp TILDE2 &kp MINUS &kp GRAVE &kp LBKT &kp RBKT &kp DEL
|
||||
&mo 1 &kp LGUI &kp RGUI &mo 2
|
||||
>;
|
||||
};
|
||||
|
||||
right_layer {
|
||||
bindings = <
|
||||
&kp BANG &kp ATSN &kp HASH &kp DLLR &kp PRCT &kp CRRT &kp AMPS &kp KMLT &kp LPRN &kp RPRN
|
||||
&kp HASH &kp QMARK &kp FSLH &kp COLN &kp SCLN &kp MINUS &kp KP_EQUAL &kp LBRC &kp RBRC &kp BKSP
|
||||
&kp LSFT &kp KPLS &kp LBKT &kp RBKT &kp BSLH &kp UNDER &kp LEFT &kp DOWN &kp UP &kp RIGHT
|
||||
&mo 3 &kp LCTL &kp SPC &mo 2
|
||||
>;
|
||||
};
|
||||
|
||||
tri_layer {
|
||||
bindings = <
|
||||
&kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &trans &trans &trans &trans &trans
|
||||
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &trans &kp PG_UP &kp K_VOL_UP &kp K_MUTE &trans
|
||||
&bt BT_CLR &bt BT_NXT &bt BT_PRV &kp F6 &kp F7 &trans &kp PG_DN &kp K_VOL_DN &trans &trans
|
||||
&trans &trans &trans &trans
|
||||
>;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
# Copyright (c) 2020 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
#define RSE 2
|
||||
#define ADJ 3
|
||||
|
||||
< { quick_tap_ms = <200>; };
|
||||
&mt { quick_tap_ms = <200>; };
|
||||
|
||||
/ {
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
|
@ -26,7 +29,7 @@
|
|||
bindings = <
|
||||
&kp LWIN &kp GRAVE &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &mt RWIN RBKT
|
||||
&kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &mt RCTRL SQT
|
||||
&kp LALT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp BSLH
|
||||
&kp LALT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &mt RALT BSLH
|
||||
< RSE TAB &mt LSHFT SPACE < LWR RET < LWR ESC &mt RSHFT BSPC < RSE DEL
|
||||
>;
|
||||
};
|
||||
|
|
|
@ -108,6 +108,6 @@ static const struct kscan_composite_config kscan_composite_config = {};
|
|||
|
||||
static struct kscan_composite_data kscan_composite_data;
|
||||
|
||||
DEVICE_AND_API_INIT(kscan_composite, DT_INST_LABEL(0), kscan_composite_init, &kscan_composite_data,
|
||||
DEVICE_DT_INST_DEFINE(0, kscan_composite_init, device_pm_control_nop, &kscan_composite_data,
|
||||
&kscan_composite_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
&mock_driver_api);
|
||||
|
|
|
@ -113,6 +113,8 @@ struct kscan_gpio_item_config {
|
|||
&kscan_gpio_output_configs_##n(dev)[bit]; \
|
||||
gpio_pin_set(out_dev, out_cfg->pin, state); \
|
||||
} \
|
||||
/* Let the col settle before reading the rows */ \
|
||||
k_usleep(1); \
|
||||
\
|
||||
for (int i = 0; i < INST_MATRIX_INPUTS(n); i++) { \
|
||||
/* Get the input device (port) */ \
|
||||
|
@ -246,9 +248,9 @@ struct kscan_gpio_item_config {
|
|||
.cols = {UTIL_LISTIFY(INST_DEMUX_GPIOS(n), _KSCAN_GPIO_OUTPUT_CFG_INIT, n)}, \
|
||||
}; \
|
||||
\
|
||||
DEVICE_AND_API_INIT(kscan_gpio_##n, DT_INST_LABEL(n), kscan_gpio_init_##n, \
|
||||
&kscan_gpio_data_##n, &kscan_gpio_config_##n, APPLICATION, \
|
||||
CONFIG_APPLICATION_INIT_PRIORITY, &gpio_driver_api_##n);
|
||||
DEVICE_DT_INST_DEFINE(n, kscan_gpio_init_##n, device_pm_control_nop, &kscan_gpio_data_##n, \
|
||||
&kscan_gpio_config_##n, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, \
|
||||
&gpio_driver_api_##n);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT)
|
||||
|
||||
|
|
|
@ -238,9 +238,9 @@ static const struct kscan_driver_api gpio_driver_api = {
|
|||
.inputs = {UTIL_LISTIFY(INST_INPUT_LEN(n), KSCAN_DIRECT_INPUT_ITEM, n)}, \
|
||||
.num_of_inputs = INST_INPUT_LEN(n), \
|
||||
.debounce_period = DT_INST_PROP(n, debounce_period)}; \
|
||||
DEVICE_AND_API_INIT(kscan_gpio_##n, DT_INST_LABEL(n), kscan_gpio_init_##n, \
|
||||
&kscan_gpio_data_##n, &kscan_gpio_config_##n, POST_KERNEL, \
|
||||
CONFIG_ZMK_KSCAN_INIT_PRIORITY, &gpio_driver_api);
|
||||
DEVICE_DT_INST_DEFINE(n, kscan_gpio_init_##n, device_pm_control_nop, &kscan_gpio_data_##n, \
|
||||
&kscan_gpio_config_##n, POST_KERNEL, CONFIG_ZMK_KSCAN_INIT_PRIORITY, \
|
||||
&gpio_driver_api);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT)
|
||||
|
||||
|
|
|
@ -298,9 +298,9 @@ static int kscan_gpio_config_interrupts(const struct device **devices,
|
|||
.rows = {UTIL_LISTIFY(INST_MATRIX_ROWS(n), _KSCAN_GPIO_ROW_CFG_INIT, n)}, \
|
||||
.cols = {UTIL_LISTIFY(INST_MATRIX_COLS(n), _KSCAN_GPIO_COL_CFG_INIT, n)}, \
|
||||
}; \
|
||||
DEVICE_AND_API_INIT(kscan_gpio_##n, DT_INST_LABEL(n), kscan_gpio_init_##n, \
|
||||
&kscan_gpio_data_##n, &kscan_gpio_config_##n, APPLICATION, \
|
||||
CONFIG_APPLICATION_INIT_PRIORITY, &gpio_driver_api_##n);
|
||||
DEVICE_DT_INST_DEFINE(n, kscan_gpio_init_##n, device_pm_control_nop, &kscan_gpio_data_##n, \
|
||||
&kscan_gpio_config_##n, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, \
|
||||
&gpio_driver_api_##n);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT)
|
||||
|
||||
|
|
|
@ -88,8 +88,8 @@ static int kscan_mock_configure(const struct device *dev, kscan_callback_t callb
|
|||
static struct kscan_mock_data kscan_mock_data_##n; \
|
||||
static const struct kscan_mock_config_##n kscan_mock_config_##n = { \
|
||||
.events = DT_INST_PROP(n, events), .exit_after = DT_INST_PROP(n, exit_after)}; \
|
||||
DEVICE_AND_API_INIT(kscan_mock_##n, DT_INST_LABEL(n), kscan_mock_init_##n, \
|
||||
&kscan_mock_data_##n, &kscan_mock_config_##n, APPLICATION, \
|
||||
DEVICE_DT_INST_DEFINE(n, kscan_mock_init_##n, device_pm_control_nop, &kscan_mock_data_##n, \
|
||||
&kscan_mock_config_##n, APPLICATION, \
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &mock_driver_api_##n);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(MOCK_INST_INIT)
|
||||
|
|
|
@ -217,5 +217,5 @@ static const struct bvd_config bvd_cfg = {
|
|||
.full_ohm = DT_INST_PROP(0, full_ohms),
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(bvd_dev, DT_INST_LABEL(0), &bvd_init, &bvd_data, &bvd_cfg, POST_KERNEL,
|
||||
DEVICE_DT_INST_DEFINE(0, &bvd_init, device_pm_control_nop, &bvd_data, &bvd_cfg, POST_KERNEL,
|
||||
CONFIG_SENSOR_INIT_PRIORITY, &bvd_api);
|
||||
|
|
|
@ -142,7 +142,7 @@ int ec11_init(const struct device *dev) {
|
|||
.b_flags = DT_INST_GPIO_FLAGS(n, b_gpios), \
|
||||
COND_CODE_0(DT_INST_NODE_HAS_PROP(n, resolution), (1), (DT_INST_PROP(n, resolution))), \
|
||||
}; \
|
||||
DEVICE_AND_API_INIT(ec11_##n, DT_INST_LABEL(n), ec11_init, &ec11_data_##n, &ec11_cfg_##n, \
|
||||
DEVICE_DT_INST_DEFINE(n, ec11_init, device_pm_control_nop, &ec11_data_##n, &ec11_cfg_##n, \
|
||||
POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY, &ec11_driver_api);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(EC11_INST)
|
|
@ -768,6 +768,7 @@
|
|||
|
||||
/* Keyboard Left Shift */
|
||||
#define LEFT_SHIFT (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFTSHIFT))
|
||||
#define LSHIFT (LEFT_SHIFT)
|
||||
#define LSHFT (LEFT_SHIFT)
|
||||
#define LSFT (LEFT_SHIFT) // WARNING: DEPRECATED (DO NOT USE)
|
||||
|
||||
|
@ -792,6 +793,7 @@
|
|||
|
||||
/* Keyboard Right Shift */
|
||||
#define RIGHT_SHIFT (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHTSHIFT))
|
||||
#define RSHIFT (RIGHT_SHIFT)
|
||||
#define RSHFT (RIGHT_SHIFT)
|
||||
#define RSFT (RIGHT_SHIFT) // WARNING: DEPRECATED (DO NOT USE)
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ testcases=$(find $path -name native_posix.keymap -exec dirname \{\} \;)
|
|||
num_cases=$(echo "$testcases" | wc -l)
|
||||
if [ $num_cases -gt 1 ]; then
|
||||
echo "" > ./build/tests/pass-fail.log
|
||||
echo "$testcases" | xargs -L 1 -P 4 ./run-test.sh
|
||||
echo "$testcases" | xargs -L 1 -P ${J:-4} ./run-test.sh
|
||||
err=$?
|
||||
sort -k2 ./build/tests/pass-fail.log
|
||||
exit $err
|
||||
|
|
|
@ -49,7 +49,7 @@ static const struct behavior_driver_api behavior_bt_driver_api = {
|
|||
.binding_released = on_keymap_binding_released,
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(behavior_bt, DT_INST_LABEL(0), behavior_bt_init, NULL, NULL, APPLICATION,
|
||||
DEVICE_DT_INST_DEFINE(0, behavior_bt_init, device_pm_control_nop, NULL, NULL, APPLICATION,
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_bt_driver_api);
|
||||
|
||||
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */
|
|
@ -73,7 +73,7 @@ static const struct behavior_driver_api behavior_ext_power_driver_api = {
|
|||
.binding_released = on_keymap_binding_released,
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(behavior_ext_power, DT_INST_LABEL(0), behavior_ext_power_init, NULL, NULL,
|
||||
APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, &behavior_ext_power_driver_api);
|
||||
DEVICE_DT_INST_DEFINE(0, behavior_ext_power_init, device_pm_control_nop, NULL, NULL, APPLICATION,
|
||||
CONFIG_APPLICATION_INIT_PRIORITY, &behavior_ext_power_driver_api);
|
||||
|
||||
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */
|
||||
|
|
|
@ -449,11 +449,7 @@ static int on_hold_tap_binding_pressed(struct zmk_behavior_binding *binding,
|
|||
// if this behavior was queued we have to adjust the timer to only
|
||||
// wait for the remaining time.
|
||||
int32_t tapping_term_ms_left = (hold_tap->timestamp + cfg->tapping_term_ms) - k_uptime_get();
|
||||
if (tapping_term_ms_left > 0) {
|
||||
k_delayed_work_submit(&hold_tap->work, K_MSEC(tapping_term_ms_left));
|
||||
} else {
|
||||
decide_hold_tap(hold_tap, HT_TIMER_EVENT);
|
||||
}
|
||||
|
||||
return ZMK_BEHAVIOR_OPAQUE;
|
||||
}
|
||||
|
@ -609,7 +605,7 @@ static struct behavior_hold_tap_data behavior_hold_tap_data;
|
|||
.flavor = DT_ENUM_IDX(DT_DRV_INST(n), flavor), \
|
||||
.retro_tap = DT_INST_PROP(n, retro_tap), \
|
||||
}; \
|
||||
DEVICE_AND_API_INIT(behavior_hold_tap_##n, DT_INST_LABEL(n), behavior_hold_tap_init, \
|
||||
DEVICE_DT_INST_DEFINE(n, behavior_hold_tap_init, device_pm_control_nop, \
|
||||
&behavior_hold_tap_data, &behavior_hold_tap_config_##n, APPLICATION, \
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_hold_tap_driver_api);
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@ static const struct behavior_driver_api behavior_key_press_driver_api = {
|
|||
.binding_pressed = on_keymap_binding_pressed, .binding_released = on_keymap_binding_released};
|
||||
|
||||
#define KP_INST(n) \
|
||||
DEVICE_AND_API_INIT(behavior_key_press_##n, DT_INST_LABEL(n), behavior_key_press_init, NULL, \
|
||||
NULL, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
|
||||
DEVICE_DT_INST_DEFINE(n, behavior_key_press_init, device_pm_control_nop, NULL, NULL, \
|
||||
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
|
||||
&behavior_key_press_driver_api);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(KP_INST)
|
||||
|
|
|
@ -90,9 +90,10 @@ static int behavior_mod_morph_init(const struct device *dev) { return 0; }
|
|||
.mods = DT_INST_PROP(n, mods), \
|
||||
}; \
|
||||
static struct behavior_mod_morph_data behavior_mod_morph_data_##n = {}; \
|
||||
DEVICE_AND_API_INIT(behavior_mod_morph_##n, DT_INST_LABEL(n), behavior_mod_morph_init, \
|
||||
&behavior_mod_morph_data_##n, &behavior_mod_morph_config_##n, APPLICATION, \
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_mod_morph_driver_api);
|
||||
DEVICE_DT_INST_DEFINE(n, behavior_mod_morph_init, device_pm_control_nop, \
|
||||
&behavior_mod_morph_data_##n, &behavior_mod_morph_config_##n, \
|
||||
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
|
||||
&behavior_mod_morph_driver_api);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(KP_INST)
|
||||
|
||||
|
|
|
@ -39,6 +39,6 @@ static const struct behavior_mo_config behavior_mo_config = {};
|
|||
|
||||
static struct behavior_mo_data behavior_mo_data;
|
||||
|
||||
DEVICE_AND_API_INIT(behavior_mo, DT_INST_LABEL(0), behavior_mo_init, &behavior_mo_data,
|
||||
DEVICE_DT_INST_DEFINE(0, behavior_mo_init, device_pm_control_nop, &behavior_mo_data,
|
||||
&behavior_mo_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
&behavior_mo_driver_api);
|
||||
|
|
|
@ -34,7 +34,7 @@ static const struct behavior_driver_api behavior_none_driver_api = {
|
|||
.binding_released = on_keymap_binding_released,
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(behavior_none, DT_INST_LABEL(0), behavior_none_init, NULL, NULL, APPLICATION,
|
||||
DEVICE_DT_INST_DEFINE(0, behavior_none_init, device_pm_control_nop, NULL, NULL, APPLICATION,
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_none_driver_api);
|
||||
|
||||
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */
|
|
@ -42,7 +42,7 @@ static const struct behavior_driver_api behavior_outputs_driver_api = {
|
|||
.binding_pressed = on_keymap_binding_pressed,
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(behavior_out, DT_INST_LABEL(0), behavior_out_init, NULL, NULL, APPLICATION,
|
||||
DEVICE_DT_INST_DEFINE(0, behavior_out_init, device_pm_control_nop, NULL, NULL, APPLICATION,
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_outputs_driver_api);
|
||||
|
||||
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */
|
||||
|
|
|
@ -41,7 +41,7 @@ static const struct behavior_driver_api behavior_reset_driver_api = {
|
|||
#define RST_INST(n) \
|
||||
static const struct behavior_reset_config behavior_reset_config_##n = { \
|
||||
.type = DT_INST_PROP(n, type)}; \
|
||||
DEVICE_AND_API_INIT(behavior_reset_##n, DT_INST_LABEL(n), behavior_reset_init, NULL, \
|
||||
DEVICE_DT_INST_DEFINE(n, behavior_reset_init, device_pm_control_nop, NULL, \
|
||||
&behavior_reset_config_##n, APPLICATION, \
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_reset_driver_api);
|
||||
|
||||
|
|
|
@ -136,8 +136,8 @@ static const struct behavior_driver_api behavior_rgb_underglow_driver_api = {
|
|||
.binding_released = on_keymap_binding_released,
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(behavior_rgb_underglow, DT_INST_LABEL(0), behavior_rgb_underglow_init, NULL,
|
||||
NULL, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
DEVICE_DT_INST_DEFINE(0, behavior_rgb_underglow_init, device_pm_control_nop, NULL, NULL,
|
||||
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
&behavior_rgb_underglow_driver_api);
|
||||
|
||||
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */
|
||||
|
|
|
@ -59,9 +59,8 @@ static const struct behavior_driver_api behavior_sensor_rotate_key_press_driver_
|
|||
.sensor_binding_triggered = on_sensor_binding_triggered};
|
||||
|
||||
#define KP_INST(n) \
|
||||
DEVICE_AND_API_INIT(behavior_sensor_rotate_key_press_##n, DT_INST_LABEL(n), \
|
||||
behavior_sensor_rotate_key_press_init, NULL, NULL, APPLICATION, \
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
|
||||
DEVICE_DT_INST_DEFINE(n, behavior_sensor_rotate_key_press_init, device_pm_control_nop, NULL, \
|
||||
NULL, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
|
||||
&behavior_sensor_rotate_key_press_driver_api);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(KP_INST)
|
||||
|
|
|
@ -177,6 +177,11 @@ static const struct behavior_driver_api behavior_sticky_key_driver_api = {
|
|||
.binding_released = on_sticky_key_binding_released,
|
||||
};
|
||||
|
||||
static int sticky_key_keycode_state_changed_listener(const zmk_event_t *eh);
|
||||
|
||||
ZMK_LISTENER(behavior_sticky_key, sticky_key_keycode_state_changed_listener);
|
||||
ZMK_SUBSCRIPTION(behavior_sticky_key, zmk_keycode_state_changed);
|
||||
|
||||
static int sticky_key_keycode_state_changed_listener(const zmk_event_t *eh) {
|
||||
struct zmk_keycode_state_changed *ev = as_zmk_keycode_state_changed(eh);
|
||||
if (ev == NULL) {
|
||||
|
@ -212,7 +217,10 @@ static int sticky_key_keycode_state_changed_listener(const zmk_event_t *eh) {
|
|||
if (sticky_key->timer_started) {
|
||||
stop_timer(sticky_key);
|
||||
if (sticky_key->config->quick_release) {
|
||||
// continue processing the event. Release the sticky key afterwards.
|
||||
ZMK_EVENT_RAISE_AFTER(eh, behavior_sticky_key);
|
||||
release_sticky_key_behavior(sticky_key, ev->timestamp);
|
||||
return ZMK_EV_EVENT_CAPTURED;
|
||||
}
|
||||
}
|
||||
sticky_key->modified_key_usage_page = ev->usage_page;
|
||||
|
@ -229,9 +237,6 @@ static int sticky_key_keycode_state_changed_listener(const zmk_event_t *eh) {
|
|||
return ZMK_EV_EVENT_BUBBLE;
|
||||
}
|
||||
|
||||
ZMK_LISTENER(behavior_sticky_key, sticky_key_keycode_state_changed_listener);
|
||||
ZMK_SUBSCRIPTION(behavior_sticky_key, zmk_keycode_state_changed);
|
||||
|
||||
void behavior_sticky_key_timer_handler(struct k_work *item) {
|
||||
struct active_sticky_key *sticky_key =
|
||||
CONTAINER_OF(item, struct active_sticky_key, release_timer);
|
||||
|
@ -267,7 +272,7 @@ static struct behavior_sticky_key_data behavior_sticky_key_data;
|
|||
.release_after_ms = DT_INST_PROP(n, release_after_ms), \
|
||||
.quick_release = DT_INST_PROP(n, quick_release), \
|
||||
}; \
|
||||
DEVICE_AND_API_INIT(behavior_sticky_key_##n, DT_INST_LABEL(n), behavior_sticky_key_init, \
|
||||
DEVICE_DT_INST_DEFINE(n, behavior_sticky_key_init, device_pm_control_nop, \
|
||||
&behavior_sticky_key_data, &behavior_sticky_key_config_##n, APPLICATION, \
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_sticky_key_driver_api);
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ static const struct behavior_driver_api behavior_to_driver_api = {
|
|||
.binding_released = to_keymap_binding_released,
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(behavior_to, DT_INST_LABEL(0), behavior_to_init, NULL, NULL, APPLICATION,
|
||||
DEVICE_DT_INST_DEFINE(0, behavior_to_init, device_pm_control_nop, NULL, NULL, APPLICATION,
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_to_driver_api);
|
||||
|
||||
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */
|
||||
|
|
|
@ -43,7 +43,7 @@ static const struct behavior_tog_config behavior_tog_config = {};
|
|||
|
||||
static struct behavior_tog_data behavior_tog_data;
|
||||
|
||||
DEVICE_AND_API_INIT(behavior_tog, DT_INST_LABEL(0), behavior_tog_init, &behavior_tog_data,
|
||||
DEVICE_DT_INST_DEFINE(0, behavior_tog_init, device_pm_control_nop, &behavior_tog_data,
|
||||
&behavior_tog_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
&behavior_tog_driver_api);
|
||||
|
||||
|
|
|
@ -34,8 +34,7 @@ static const struct behavior_driver_api behavior_transparent_driver_api = {
|
|||
.binding_released = on_keymap_binding_released,
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(behavior_transparent, DT_INST_LABEL(0), behavior_transparent_init, NULL, NULL,
|
||||
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
&behavior_transparent_driver_api);
|
||||
DEVICE_DT_INST_DEFINE(0, behavior_transparent_init, device_pm_control_nop, NULL, NULL, APPLICATION,
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_transparent_driver_api);
|
||||
|
||||
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */
|
|
@ -7,6 +7,7 @@
|
|||
#include <device.h>
|
||||
#include <init.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
@ -250,6 +251,10 @@ static int ble_save_profile() {
|
|||
}
|
||||
|
||||
int zmk_ble_prof_select(uint8_t index) {
|
||||
if (index >= PROFILE_COUNT) {
|
||||
return -ERANGE;
|
||||
}
|
||||
|
||||
LOG_DBG("profile %d", index);
|
||||
if (active_profile == index) {
|
||||
return 0;
|
||||
|
|
|
@ -188,8 +188,15 @@ static int64_t first_candidate_timeout() {
|
|||
static inline bool candidate_is_completely_pressed(struct combo_cfg *candidate) {
|
||||
// this code assumes set(pressed_keys) <= set(candidate->key_positions)
|
||||
// this invariant is enforced by filter_candidates
|
||||
// the only thing we need to do is check if len(pressed_keys) == len(combo->key_positions)
|
||||
return pressed_keys[candidate->key_position_len - 1] != NULL;
|
||||
// since events may have been reraised after clearing one or more slots at
|
||||
// the start of pressed_keys (see: release_pressed_keys), we have to check
|
||||
// that each key needed to trigger the combo was pressed, not just the last.
|
||||
for (int i = 0; i < candidate->key_position_len; i++) {
|
||||
if (pressed_keys[i] == NULL) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static int cleanup();
|
||||
|
|
|
@ -26,14 +26,16 @@ static lv_obj_t *screen;
|
|||
|
||||
__attribute__((weak)) lv_obj_t *zmk_display_status_screen() { return NULL; }
|
||||
|
||||
void display_tick_cb(struct k_work *work) {
|
||||
lv_tick_inc(10);
|
||||
lv_task_handler();
|
||||
}
|
||||
void display_tick_cb(struct k_work *work) { lv_task_handler(); }
|
||||
|
||||
#define TICK_MS 10
|
||||
|
||||
K_WORK_DEFINE(display_tick_work, display_tick_cb);
|
||||
|
||||
void display_timer_cb() { k_work_submit(&display_tick_work); }
|
||||
void display_timer_cb() {
|
||||
lv_tick_inc(TICK_MS);
|
||||
k_work_submit(&display_tick_work);
|
||||
}
|
||||
|
||||
K_TIMER_DEFINE(display_timer, display_timer_cb, NULL);
|
||||
|
||||
|
@ -44,7 +46,7 @@ static void start_display_updates() {
|
|||
|
||||
display_blanking_off(display);
|
||||
|
||||
k_timer_start(&display_timer, K_MSEC(10), K_MSEC(10));
|
||||
k_timer_start(&display_timer, K_MSEC(TICK_MS), K_MSEC(TICK_MS));
|
||||
}
|
||||
|
||||
static void stop_display_updates() {
|
||||
|
@ -75,8 +77,6 @@ int zmk_display_init() {
|
|||
|
||||
lv_scr_load(screen);
|
||||
|
||||
lv_task_handler();
|
||||
|
||||
start_display_updates();
|
||||
|
||||
LOG_DBG("");
|
||||
|
|
|
@ -231,13 +231,7 @@ static const struct ext_power_api api = {.enable = ext_power_generic_enable,
|
|||
|
||||
#define ZMK_EXT_POWER_INIT_PRIORITY 81
|
||||
|
||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
||||
DEVICE_DEFINE(ext_power_generic, DT_INST_LABEL(0), ext_power_generic_init,
|
||||
&ext_power_generic_pm_control, &data, &config, POST_KERNEL,
|
||||
ZMK_EXT_POWER_INIT_PRIORITY, &api);
|
||||
#else
|
||||
DEVICE_AND_API_INIT(ext_power_generic, DT_INST_LABEL(0), ext_power_generic_init, &data, &config,
|
||||
DEVICE_DT_INST_DEFINE(0, ext_power_generic_init, &ext_power_generic_pm_control, &data, &config,
|
||||
POST_KERNEL, ZMK_EXT_POWER_INIT_PRIORITY, &api);
|
||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
||||
|
||||
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */
|
||||
|
|
|
@ -23,18 +23,12 @@ bool is_usb_power_present() {
|
|||
#endif /* CONFIG_USB */
|
||||
}
|
||||
|
||||
enum power_states sys_pm_policy_next_state(int32_t ticks) {
|
||||
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
|
||||
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
||||
struct pm_state_info pm_policy_next_state(int32_t ticks) {
|
||||
if (zmk_activity_get_state() == ZMK_ACTIVITY_SLEEP && !is_usb_power_present()) {
|
||||
return SYS_POWER_STATE_DEEP_SLEEP_1;
|
||||
}
|
||||
#endif /* CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1 */
|
||||
#endif /* CONFIG_SYS_POWER_DEEP_SLEEP_STATES */
|
||||
|
||||
return SYS_POWER_STATE_ACTIVE;
|
||||
return (struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0};
|
||||
}
|
||||
|
||||
bool sys_pm_policy_low_power_devices(enum power_states pm_state) {
|
||||
return sys_pm_is_sleep_state(pm_state);
|
||||
return (struct pm_state_info){PM_STATE_ACTIVE, 0, 0};
|
||||
}
|
||||
|
||||
__weak bool pm_policy_low_power_devices(enum pm_state state) { return pm_is_sleep_state(state); }
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
pressed: usage_page 0x07 keycode 0x1d implicit_mods 0x00 explicit_mods 0x00
|
||||
released: usage_page 0x07 keycode 0x1d implicit_mods 0x00 explicit_mods 0x00
|
|
@ -0,0 +1,39 @@
|
|||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/kscan-mock.h>
|
||||
|
||||
/ {
|
||||
combos {
|
||||
compatible = "zmk,combos";
|
||||
combo_one {
|
||||
timeout-ms = <80>;
|
||||
key-positions = <0 1 2 3>;
|
||||
bindings = <&kp Z>;
|
||||
};
|
||||
};
|
||||
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
label ="Default keymap";
|
||||
|
||||
default_layer {
|
||||
bindings = <
|
||||
&kp A &kp B
|
||||
&kp C &kp D
|
||||
>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&kscan {
|
||||
events = <
|
||||
ZMK_MOCK_PRESS(1,1,10)
|
||||
ZMK_MOCK_PRESS(0,1,10)
|
||||
ZMK_MOCK_PRESS(1,0,10)
|
||||
ZMK_MOCK_PRESS(0,0,10)
|
||||
ZMK_MOCK_RELEASE(0,0,100)
|
||||
ZMK_MOCK_RELEASE(1,0,100)
|
||||
ZMK_MOCK_RELEASE(0,1,100)
|
||||
ZMK_MOCK_RELEASE(1,1,100)
|
||||
>;
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
s/.*hid_listener_keycode_//p
|
|
@ -0,0 +1 @@
|
|||
s/.*hid_listener_keycode_//p
|
|
@ -0,0 +1,6 @@
|
|||
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||
pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00
|
||||
pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00
|
||||
released: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00
|
||||
released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00
|
||||
released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
|
@ -0,0 +1,37 @@
|
|||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/kscan-mock.h>
|
||||
|
||||
/ {
|
||||
combos {
|
||||
compatible = "zmk,combos";
|
||||
combo_one {
|
||||
timeout-ms = <80>;
|
||||
key-positions = <0 1 2>;
|
||||
bindings = <&kp Z>;
|
||||
};
|
||||
};
|
||||
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
label ="Default keymap";
|
||||
|
||||
default_layer {
|
||||
bindings = <
|
||||
&kp A &kp B
|
||||
&kp C &kp D
|
||||
>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&kscan {
|
||||
events = <
|
||||
ZMK_MOCK_PRESS(0,0,10)
|
||||
ZMK_MOCK_PRESS(0,1,10)
|
||||
ZMK_MOCK_PRESS(1,1,10)
|
||||
ZMK_MOCK_RELEASE(1,1,100)
|
||||
ZMK_MOCK_RELEASE(0,1,100)
|
||||
ZMK_MOCK_RELEASE(0,0,100)
|
||||
>;
|
||||
};
|
|
@ -0,0 +1,4 @@
|
|||
s/.*hid_listener_keycode/kp/p
|
||||
s/.*mo_keymap_binding/mo/p
|
||||
s/.*on_hold_tap_binding/ht_binding/p
|
||||
s/.*decide_hold_tap/ht_decide/p
|
|
@ -0,0 +1,10 @@
|
|||
ht_binding_pressed: 0 new undecided hold_tap
|
||||
ht_decide: 0 decided hold-timer (tap-preferred decision moment timer)
|
||||
kp_pressed: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00
|
||||
ht_binding_pressed: 1 new undecided hold_tap
|
||||
ht_decide: 1 decided tap (tap-preferred decision moment key-up)
|
||||
kp_pressed: usage_page 0x07 keycode 0x0d implicit_mods 0x00 explicit_mods 0x00
|
||||
kp_released: usage_page 0x07 keycode 0x0d implicit_mods 0x00 explicit_mods 0x00
|
||||
ht_binding_released: 1 cleaning up hold-tap
|
||||
kp_released: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00
|
||||
ht_binding_released: 0 cleaning up hold-tap
|
|
@ -0,0 +1,53 @@
|
|||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/kscan_mock.h>
|
||||
|
||||
/*
|
||||
* A hold-tap with long tapping term is pressed first.
|
||||
* A hold-tap with short tapping term is quickly tapped.
|
||||
* The short tapping term hold-tap should 'tap', not 'hold'.
|
||||
*/
|
||||
|
||||
/ {
|
||||
behaviors {
|
||||
tp_short: short_tap {
|
||||
compatible = "zmk,behavior-hold-tap";
|
||||
label = "MOD_TAP_SHORT";
|
||||
#binding-cells = <2>;
|
||||
flavor = "tap-preferred";
|
||||
tapping-term-ms = <100>;
|
||||
quick-tap-ms = <200>;
|
||||
bindings = <&kp>, <&kp>;
|
||||
};
|
||||
tp_long: long_tap {
|
||||
compatible = "zmk,behavior-hold-tap";
|
||||
label = "MOD_TAP_LONG";
|
||||
#binding-cells = <2>;
|
||||
flavor = "tap-preferred";
|
||||
tapping-term-ms = <200>;
|
||||
quick-tap-ms = <200>;
|
||||
bindings = <&kp>, <&kp>;
|
||||
};
|
||||
};
|
||||
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
label ="Default keymap";
|
||||
|
||||
default_layer {
|
||||
bindings = <
|
||||
&tp_long LEFT_SHIFT F &tp_short LEFT_CONTROL J
|
||||
&kp D &kp RIGHT_CONTROL>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
&kscan {
|
||||
events = <
|
||||
ZMK_MOCK_PRESS(0,0,20)
|
||||
ZMK_MOCK_PRESS(0,1,20)
|
||||
ZMK_MOCK_RELEASE(0,1,200)
|
||||
ZMK_MOCK_RELEASE(0,0,10)
|
||||
>;
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
s/.*hid_listener_keycode_//p
|
|
@ -0,0 +1,10 @@
|
|||
pressed: usage_page 0x07 keycode 0x08 implicit_mods 0x00 explicit_mods 0x00
|
||||
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||
released: usage_page 0x07 keycode 0x08 implicit_mods 0x00 explicit_mods 0x00
|
||||
pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00
|
||||
released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||
released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00
|
||||
pressed: usage_page 0x07 keycode 0x08 implicit_mods 0x00 explicit_mods 0x00
|
||||
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||
released: usage_page 0x07 keycode 0x08 implicit_mods 0x00 explicit_mods 0x00
|
||||
released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
|
@ -0,0 +1,26 @@
|
|||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/kscan_mock.h>
|
||||
#include "../behavior_keymap.dtsi"
|
||||
|
||||
&sk {
|
||||
quick-release;
|
||||
};
|
||||
|
||||
&kscan {
|
||||
events = <
|
||||
ZMK_MOCK_PRESS(0,0,10)
|
||||
ZMK_MOCK_RELEASE(0,0,10)
|
||||
ZMK_MOCK_PRESS(1,0,10)
|
||||
/* second key is pressed shortly after the first. It should not be capitalized. */
|
||||
ZMK_MOCK_PRESS(1,1,10)
|
||||
ZMK_MOCK_RELEASE(1,0,10)
|
||||
ZMK_MOCK_RELEASE(1,1,10)
|
||||
|
||||
/* repeat test to check if cleanup is done correctly */
|
||||
ZMK_MOCK_PRESS(0,0,10)
|
||||
ZMK_MOCK_RELEASE(0,0,10)
|
||||
ZMK_MOCK_PRESS(1,0,10)
|
||||
ZMK_MOCK_RELEASE(1,0,10)
|
||||
>;
|
||||
};
|
|
@ -9,7 +9,7 @@ manifest:
|
|||
projects:
|
||||
- name: zephyr
|
||||
remote: zmkfirmware
|
||||
revision: v2.4.0+zmk-fixes
|
||||
revision: v2.5.0+zmk-fixes
|
||||
clone-depth: 1
|
||||
import:
|
||||
# TODO: Rename once upstream offers option like `exclude` or `denylist`
|
||||
|
|
|
@ -10,7 +10,6 @@ module.exports = {
|
|||
"plugin:react/recommended",
|
||||
"plugin:mdx/recommended",
|
||||
"prettier",
|
||||
"prettier/react",
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaFeatures: {
|
||||
|
|
|
@ -16,16 +16,16 @@ Hacktoberfest activity, and a current open call for community feedback on a ZMK
|
|||
|
||||
So much going on in ZMK!
|
||||
|
||||
- Added a new generic [Hold Tap behavior](https://zmkfirmware.dev/docs/behaviors/hold-tap)
|
||||
- Added a new generic [Hold Tap behavior](https://zmk.dev/docs/behaviors/hold-tap)
|
||||
in [#146](https://github.com/zmkfirmware/zmk/pull/146) which now powers mod-tap, layer-tap, etc. - [okke-formsma]
|
||||
- [BLE profile/connection management](https://zmkfirmware.dev/docs/behaviors/bluetooth)
|
||||
- [BLE profile/connection management](https://zmk.dev/docs/behaviors/bluetooth)
|
||||
in [#133](https://github.com/zmkfirmware/zmk/pull/133) - [petejohanson]
|
||||
- Integration tests were added to automate testing of behaviors in [#131](https://github.com/zmkfirmware/zmk/pull/131) by [BrainWart] & [petejohanson]
|
||||
- [Toggle layer behavior](https://zmkfirmware.dev/docs/behaviors/layers#toggle-layer), e.g. `&tog LOWER`, in
|
||||
- [Toggle layer behavior](https://zmk.dev/docs/behaviors/layers#toggle-layer), e.g. `&tog LOWER`, in
|
||||
[#98](https://github.com/zmkfirmware/zmk/pull/98) - [BrainWart]
|
||||
- Key fix for dropped press/release over HID [#93](https://github.com/zmkfirmware/zmk/pull/93)/[#96](https://github.com/zmkfirmware/zmk/pull/96) - [careyk007](https://github.com/careyk007) & [petejohanson]
|
||||
- Code formatting standardized using `clang-format` in [#183](https://github.com/zmkfirmware/zmk/pull/183) - [petejohanson]
|
||||
- [Bootloader reset behavior](https://zmkfirmware.dev/docs/behaviors/reset#bootloader-reset), e.g. `&bootloader`, in [#116](https://github.com/zmkfirmware/zmk/pull/116) - [petejohanson]
|
||||
- [Bootloader reset behavior](https://zmk.dev/docs/behaviors/reset#bootloader-reset), e.g. `&bootloader`, in [#116](https://github.com/zmkfirmware/zmk/pull/116) - [petejohanson]
|
||||
- Various bug fixes and documentation
|
||||
|
||||
## New Shields
|
||||
|
|
75
docs/blog/2021-07-17-zephyr-2-5.md
Normal file
75
docs/blog/2021-07-17-zephyr-2-5.md
Normal file
|
@ -0,0 +1,75 @@
|
|||
---
|
||||
title: "Zephyr 2.5 Update"
|
||||
author: Pete Johanson
|
||||
author_title: Project Creator
|
||||
author_url: https://gitlab.com/petejohanson
|
||||
author_image_url: https://www.gravatar.com/avatar/2001ceff7e9dc753cf96fcb2e6f41110
|
||||
tags: [firmware, zephyr, core]
|
||||
---
|
||||
|
||||
I'm happy to announce that we have completed the [work](https://github.com/zmkfirmware/zmk/pull/736/) to upgrade ZMK to [Zephyr 2.5](https://docs.zephyrproject.org/2.5.0/releases/release-notes-2.5.html)!
|
||||
|
||||
A big part of this work was some _major_ refactors and improvements by [innovaker] to our [zmk-docker](https://github.com/zmkfirmware/zmk-docker/) Docker image and GH Actions automation.
|
||||
|
||||
- Faster build times with improved caching.
|
||||
- Integration tests which automatically verify new images.
|
||||
- PRs to the repo now build properly and run the tests as well.
|
||||
- Build images for multiple target architectures, e.g. `zmk-build-riscv64`, all in parallel.
|
||||
- Nightly builds to be sure we're pulling in the latest OS/package updates, to ensure we keep our images up to date, address any reported vulnerabilities, etc.
|
||||
- Faster upgrade paths for future Zephyr SDK and Zephyr versions.
|
||||
|
||||
In addition, [petejohanson] did the upgrade work to adjust ZMK for the Zephyr changes.
|
||||
|
||||
- Updated to newer devicetree/driver Zephyr API
|
||||
- Adjustment for Zephyr pinmux changes
|
||||
- Fixes for power management, LVGL, and formatter changes
|
||||
|
||||
## Getting The Changes
|
||||
|
||||
Use the following steps to update to the latest tooling in order to properly use the new ZMK changes:
|
||||
|
||||
### User Config Repositories Using GitHub Actions
|
||||
|
||||
Existing user config repositories using Github Actions to build will pull down Zephyr 2.5 automatically,
|
||||
and should work, fine as is. However, to upgrade to the newer Docker image, you should:
|
||||
|
||||
- Open `.github/workflows/build.yml` in your editor/IDE
|
||||
- Change `zmkfirmware/zmk-build-arm:2.4` to `zmkfirmware/zmk-build-arm:2.5` wherever it is found
|
||||
|
||||
:::note
|
||||
|
||||
If you created your user config repository a while ago, you may find that your `build.yml` file instead references
|
||||
a `zephyr-west-action-arm` custom GitHub Action instead. In this case, the upgrade is not as direct. We suggest that
|
||||
instead you [re-create your config repository](/docs/user-setup) to get an updated setup using the new automation
|
||||
approach.
|
||||
|
||||
:::
|
||||
|
||||
### VS Code & Docker (Dev Container)
|
||||
|
||||
If you build locally using VS Code & Docker then:
|
||||
|
||||
- pull the latest ZMK `main` with `git pull` for your ZMK checkout
|
||||
- reload the project
|
||||
- if you are prompted to rebuild the remote container, click `Rebuild`
|
||||
- otherwise, press `F1` and run `Remote Containers: Rebuild Container`
|
||||
- Once the container has rebuilt and reloaded, run `west update` to pull the updated Zephyr version and its dependencies.
|
||||
|
||||
Once the container has rebuilt, VS Code will be running the 2.5 Docker image.
|
||||
|
||||
### Local Host Development
|
||||
|
||||
The following steps will get you building ZMK locally against Zephyr 2.5:
|
||||
|
||||
- Run the updated [toolchain installation](/docs/development/setup#toolchain-installation) steps, and once completed, remove the previously installed SDK version (optional, existing SDK should still work)
|
||||
- pull the latest ZMK `main` with `git pull` for your ZMK checkout
|
||||
- run `west update` to pull the updated Zephyr version and its dependencies
|
||||
|
||||
From there, you should be ready to build as normal!
|
||||
|
||||
## Thanks!
|
||||
|
||||
Thanks again to [innovaker] for all the hard work, and to all the testers who have helped verify ZMK functionality on the newer Zephyr version.
|
||||
|
||||
[petejohanson]: https://github.com/petejohanson
|
||||
[innovaker]: https://github.com/innovaker
|
|
@ -56,7 +56,7 @@ For example, if you press `&mt LEFT_SHIFT A` and then release it without pressin
|
|||
```
|
||||
&mt {
|
||||
retro-tap;
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
#### Home row mods
|
||||
|
@ -85,7 +85,7 @@ This example configures a hold-tap that works well for homerow mods:
|
|||
|
||||
default_layer {
|
||||
bindings = <
|
||||
&hm LCTRL A &hm LGUI S &hm LALT D &hm LSHFT F
|
||||
&hm LCTRL A &hm LGUI S &hm LALT D &hm LSHIFT F
|
||||
>;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -29,14 +29,13 @@ behaviors {
|
|||
#binding-cells = <0>;
|
||||
bindings = <&kp ESC>, <&kp GRAVE>;
|
||||
mods = <(MOD_LGUI|MOD_LSFT|MOD_RGUI|MOD_RSFT)>;
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
keymap {
|
||||
...
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
Note that this specific mod-morph exists in ZMK by default using code `&gresc`.
|
||||
|
|
|
@ -19,13 +19,13 @@ The Mod-Tap behavior either acts as a held modifier, or as a tapped keycode.
|
|||
### Behavior Binding
|
||||
|
||||
- Reference: `&mt`
|
||||
- Parameter #1: The keycode to be sent when activating as a modifier, e.g. `LSHFT`
|
||||
- Parameter #1: The keycode to be sent when activating as a modifier, e.g. `LSHIFT`
|
||||
- Parameter #2: The keycode to sent when used as a tap, e.g. `A`, `B`.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
&mt LSHFT A
|
||||
&mt LSHIFT A
|
||||
```
|
||||
|
||||
### Configuration
|
||||
|
@ -40,8 +40,8 @@ You can configure a different tapping term in your keymap:
|
|||
/ {
|
||||
keymap {
|
||||
...
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
### Additional information
|
||||
|
|
|
@ -12,12 +12,12 @@ By default, sticky keys stay pressed for a second if you don't press any other k
|
|||
### Behavior Binding
|
||||
|
||||
- Reference: `&sk`
|
||||
- Parameter #1: The keycode , e.g. `LSHFT`
|
||||
- Parameter #1: The keycode , e.g. `LSHIFT`
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
&sk LSHFT
|
||||
&sk LSHIFT
|
||||
```
|
||||
|
||||
You can use any keycode that works for `&kp` as parameter to `&sk`:
|
||||
|
@ -38,13 +38,13 @@ You can configure a different `release-after-ms` in your keymap:
|
|||
/ {
|
||||
keymap {
|
||||
...
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
### Advanced usage
|
||||
|
||||
Sticky keys can be combined; if you tap `&sk LCTRL` and then `&sk LSHFT` and then `&kp A`, the output will be ctrl+shift+a.
|
||||
Sticky keys can be combined; if you tap `&sk LCTRL` and then `&sk LSHIFT` and then `&kp A`, the output will be ctrl+shift+a.
|
||||
|
||||
### Comparison to QMK
|
||||
|
||||
|
|
|
@ -32,13 +32,13 @@ You can configure a different `release-after-ms` in your keymap:
|
|||
/ {
|
||||
keymap {
|
||||
...
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
### Advanced usage
|
||||
|
||||
Sticky layers behave slightly different from sticky keys. They are configured to `quick-release`. This means that the layer is released immediately when another key is pressed. "Normal" sticky keys are not `quick-release`; they are released when the next key is released. This makes it possible to combine sticky layers and sticky keys as such: tap `&sl 1`, tap `&sk LSHFT` on layer 1, tap `&kp A` on base layer to output shift+A.
|
||||
Sticky layers behave slightly different from sticky keys. They are configured to `quick-release`. This means that the layer is released immediately when another key is pressed. "Normal" sticky keys are not `quick-release`; they are released when the next key is released. This makes it possible to combine sticky layers and sticky keys as such: tap `&sl 1`, tap `&sk LSHIFT` on layer 1, tap `&kp A` on base layer to output shift+A.
|
||||
|
||||
### Comparison to QMK
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ hide_title: true
|
|||
|
||||
import OsLegend from "@site/src/components/codes/OsLegend";
|
||||
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
|
||||
import Content, { rightToc as contentToc } from "./_applications.mdx";
|
||||
import Content, { toc as contentToc } from "./_applications.mdx";
|
||||
|
||||
export const rightToc = contentToc;
|
||||
export const toc = contentToc;
|
||||
|
||||
<OsLegend />
|
||||
<ToastyContainer />
|
||||
|
|
|
@ -6,9 +6,9 @@ hide_title: true
|
|||
|
||||
import OsLegend from "@site/src/components/codes/OsLegend";
|
||||
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
|
||||
import Content, { rightToc as contentToc } from "./_editing.mdx";
|
||||
import Content, { toc as contentToc } from "./_editing.mdx";
|
||||
|
||||
export const rightToc = contentToc;
|
||||
export const toc = contentToc;
|
||||
|
||||
<OsLegend />
|
||||
<ToastyContainer />
|
||||
|
|
|
@ -7,14 +7,14 @@ slug: ./
|
|||
|
||||
import OsLegend from "@site/src/components/codes/OsLegend";
|
||||
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
|
||||
import Key, { rightToc as keyToc } from "./_keyboard-keypad.mdx";
|
||||
import Editing, { rightToc as editingToc } from "./_editing.mdx";
|
||||
import Media, { rightToc as mediaToc } from "./_media.mdx";
|
||||
import Applications, { rightToc as applicationsToc } from "./_applications.mdx";
|
||||
import InputAssist, { rightToc as inputAssistToc } from "./_input-assist.mdx";
|
||||
import Power, { rightToc as powerToc } from "./_power.mdx";
|
||||
import Key, { toc as keyToc } from "./_keyboard-keypad.mdx";
|
||||
import Editing, { toc as editingToc } from "./_editing.mdx";
|
||||
import Media, { toc as mediaToc } from "./_media.mdx";
|
||||
import Applications, { toc as applicationsToc } from "./_applications.mdx";
|
||||
import InputAssist, { toc as inputAssistToc } from "./_input-assist.mdx";
|
||||
import Power, { toc as powerToc } from "./_power.mdx";
|
||||
|
||||
export const rightToc = [
|
||||
export const toc = [
|
||||
...keyToc,
|
||||
...editingToc,
|
||||
...mediaToc,
|
||||
|
|
|
@ -6,9 +6,9 @@ hide_title: true
|
|||
|
||||
import OsLegend from "@site/src/components/codes/OsLegend";
|
||||
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
|
||||
import Content, { rightToc as contentToc } from "./_input-assist.mdx";
|
||||
import Content, { toc as contentToc } from "./_input-assist.mdx";
|
||||
|
||||
export const rightToc = contentToc;
|
||||
export const toc = contentToc;
|
||||
|
||||
<OsLegend />
|
||||
<ToastyContainer />
|
||||
|
|
|
@ -6,9 +6,9 @@ hide_title: true
|
|||
|
||||
import OsLegend from "@site/src/components/codes/OsLegend";
|
||||
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
|
||||
import Content, { rightToc as contentToc } from "./_keyboard-keypad.mdx";
|
||||
import Content, { toc as contentToc } from "./_keyboard-keypad.mdx";
|
||||
|
||||
export const rightToc = contentToc;
|
||||
export const toc = contentToc;
|
||||
|
||||
<OsLegend />
|
||||
<ToastyContainer />
|
||||
|
|
|
@ -6,9 +6,9 @@ hide_title: true
|
|||
|
||||
import OsLegend from "@site/src/components/codes/OsLegend";
|
||||
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
|
||||
import Content, { rightToc as contentToc } from "./_media.mdx";
|
||||
import Content, { toc as contentToc } from "./_media.mdx";
|
||||
|
||||
export const rightToc = contentToc;
|
||||
export const toc = contentToc;
|
||||
|
||||
<OsLegend />
|
||||
<ToastyContainer />
|
||||
|
|
|
@ -6,9 +6,9 @@ hide_title: true
|
|||
|
||||
import OsLegend from "@site/src/components/codes/OsLegend";
|
||||
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
|
||||
import Content, { rightToc as contentToc } from "./_power.mdx";
|
||||
import Content, { toc as contentToc } from "./_power.mdx";
|
||||
|
||||
export const rightToc = contentToc;
|
||||
export const toc = contentToc;
|
||||
|
||||
<OsLegend />
|
||||
<ToastyContainer />
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue