Merge branch 'main' of github.com:zmkfirmware/zmk into murphpad
This commit is contained in:
commit
dac14e2f7d
52 changed files with 396 additions and 305 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/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
|
||||
|
|
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
|
||||
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
&kscan_composite_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
&mock_driver_api);
|
||||
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);
|
||||
|
|
|
@ -248,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, \
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &mock_driver_api_##n);
|
||||
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,
|
||||
CONFIG_SENSOR_INIT_PRIORITY, &bvd_api);
|
||||
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, \
|
||||
POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY, &ec11_driver_api);
|
||||
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)
|
|
@ -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,
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_bt_driver_api);
|
||||
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) */
|
||||
|
|
|
@ -605,9 +605,9 @@ 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, \
|
||||
&behavior_hold_tap_data, &behavior_hold_tap_config_##n, APPLICATION, \
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_hold_tap_driver_api);
|
||||
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);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(KP_INST)
|
||||
|
||||
|
|
|
@ -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, \
|
||||
&behavior_key_press_driver_api);
|
||||
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,
|
||||
&behavior_mo_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
&behavior_mo_driver_api);
|
||||
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,
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_none_driver_api);
|
||||
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,
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_outputs_driver_api);
|
||||
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,9 +41,9 @@ 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, \
|
||||
&behavior_reset_config_##n, APPLICATION, \
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_reset_driver_api);
|
||||
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);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(RST_INST)
|
||||
|
||||
|
|
|
@ -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,
|
||||
&behavior_rgb_underglow_driver_api);
|
||||
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,10 +59,9 @@ 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, \
|
||||
&behavior_sensor_rotate_key_press_driver_api);
|
||||
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)
|
||||
|
||||
|
|
|
@ -272,9 +272,9 @@ 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, \
|
||||
&behavior_sticky_key_data, &behavior_sticky_key_config_##n, APPLICATION, \
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_sticky_key_driver_api);
|
||||
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);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(KP_INST)
|
||||
|
||||
|
|
|
@ -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,
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_to_driver_api);
|
||||
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,8 +43,8 @@ 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,
|
||||
&behavior_tog_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
&behavior_tog_driver_api);
|
||||
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);
|
||||
|
||||
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */
|
||||
|
|
|
@ -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) */
|
|
@ -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,
|
||||
POST_KERNEL, ZMK_EXT_POWER_INIT_PRIORITY, &api);
|
||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
||||
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 /* 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;
|
||||
return (struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0};
|
||||
}
|
||||
#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_ACTIVE, 0, 0};
|
||||
}
|
||||
|
||||
bool sys_pm_policy_low_power_devices(enum power_states pm_state) {
|
||||
return sys_pm_is_sleep_state(pm_state);
|
||||
}
|
||||
__weak bool pm_policy_low_power_devices(enum pm_state state) { return pm_is_sleep_state(state); }
|
||||
|
|
|
@ -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`
|
||||
|
|
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
|
|
@ -6,7 +6,7 @@ title: Boards, Shields, and Keymaps
|
|||
|
||||
The foundational elements needed to get a specific keyboard working with ZMK can be broken down into:
|
||||
|
||||
- A [KSCAN driver](https://docs.zephyrproject.org/2.3.0/reference/peripherals/kscan.html), which uses `compatible="zmk,kscan-gpio-matrix"` for GPIO matrix based keyboards, or uses `compatible="zmk,kscan-gpio-direct"` for small direct wires.
|
||||
- A [KSCAN driver](https://docs.zephyrproject.org/2.5.0/reference/peripherals/kscan.html), which uses `compatible="zmk,kscan-gpio-matrix"` for GPIO matrix based keyboards, or uses `compatible="zmk,kscan-gpio-direct"` for small direct wires.
|
||||
- An optional matrix transform, which defines how the KSCAN row/column events are translated into logical "key positions". This is required for non-rectangular keyboards/matrices, where the key positions don't naturally follow the row/columns from the GPIO matrix.
|
||||
- A keymap, which binds each key position to a behavior, e.g. key press, mod-tap, momentary layer, in a set of layers.
|
||||
|
||||
|
@ -27,8 +27,8 @@ in the `app/boards/${arch}/${board_name}` directory, e.g. `app/boards/arm/planck
|
|||
- A `${board_name}_defconfig` file that forces specific Kconfig settings that are specific to this hardware configuration. Mostly this is SoC settings around the specific hardware configuration.
|
||||
- `${board_name}.dts` which contains all the devicetree definitions, including:
|
||||
- An `#include` line that pulls in the specific microprocessor that is used, e.g. `#include <st/f3/stm32f303Xc.dtsi>`.
|
||||
- A [chosen](https://docs.zephyrproject.org/2.3.0/guides/dts/intro.html#aliases-and-chosen-nodes) node named `zmk,kscan` which references the configured KSCAN driver (usually a GPIO matrix)
|
||||
- (Optional) A [chosen](https://docs.zephyrproject.org/2.3.0/guides/dts/intro.html#aliases-and-chosen-nodes) node named `zmk,matrix_transform` that defines the mapping from KSCAN row/column values to the logical key position for the keyboard.
|
||||
- A [chosen](https://docs.zephyrproject.org/2.5.0/guides/dts/intro.html#aliases-and-chosen-nodes) node named `zmk,kscan` which references the configured KSCAN driver (usually a GPIO matrix)
|
||||
- (Optional) A [chosen](https://docs.zephyrproject.org/2.5.0/guides/dts/intro.html#aliases-and-chosen-nodes) node named `zmk,matrix_transform` that defines the mapping from KSCAN row/column values to the logical key position for the keyboard.
|
||||
- A `board.cmake` file with CMake directives for how to flash to the device.
|
||||
- A `keymap/keymap.overlay` file that includes the default keymap for that keyboard. Users will be able to override this keymap in their user configs.
|
||||
|
||||
|
@ -47,6 +47,6 @@ in the `app/boards/shields/${board_name}` directory, e.g. `app/boards/shields/cl
|
|||
- A `Kconfig.shield` that defines the toplevel Kconfig value for the shield, which uses a supplied utility to function to default the value based on the shield list, e.g. `def_bool $(shields_list_contains,clueboard_california)`.
|
||||
- A `Kconfig.defconfig` file to set default values for things like `ZMK_KEYBOARD_NAME`
|
||||
- A `${shield_name}.overlay` file, which is a devicetree overlay file, that includes:
|
||||
- A [chosen](https://docs.zephyrproject.org/2.3.0/guides/dts/intro.html#aliases-and-chosen-nodes) node named `zmk,kscan` which references the configured KSCAN driver (usually a GPIO matrix). For these keyboards, to be compatible with any Pro Micro compatible boards, the KSCAN configuration should reference the [nexus node](https://docs.zephyrproject.org/2.3.0/guides/porting/shields.html#gpio-nexus-nodes) that ZMK has standardized on. In particular, the `&pro_micro_a` and `&pro_micro_d` aliases can be used to reference the standard `A#` and `D#` pins in shields.
|
||||
- (Optional) A [chosen](https://docs.zephyrproject.org/2.3.0/guides/dts/intro.html#aliases-and-chosen-nodes) node named `zmk,matrix_transform` that defines the mapping from KSCAN row/column values to the logical key position for the keyboard.
|
||||
- A [chosen](https://docs.zephyrproject.org/2.5.0/guides/dts/intro.html#aliases-and-chosen-nodes) node named `zmk,kscan` which references the configured KSCAN driver (usually a GPIO matrix). For these keyboards, to be compatible with any Pro Micro compatible boards, the KSCAN configuration should reference the [nexus node](https://docs.zephyrproject.org/2.5.0/guides/porting/shields.html#gpio-nexus-nodes) that ZMK has standardized on. In particular, the `&pro_micro_a` and `&pro_micro_d` aliases can be used to reference the standard `A#` and `D#` pins in shields.
|
||||
- (Optional) A [chosen](https://docs.zephyrproject.org/2.5.0/guides/dts/intro.html#aliases-and-chosen-nodes) node named `zmk,matrix_transform` that defines the mapping from KSCAN row/column values to the logical key position for the keyboard.
|
||||
- A `keymap/keymap.overlay` file that includes the default keymap for that keyboard. Users will be able to override this keymap in their user configs.
|
||||
|
|
|
@ -31,7 +31,7 @@ an onboard MCU, or one that uses an MCU board addon.
|
|||
|
||||
### Keyboard (Shield) + MCU Board
|
||||
|
||||
ZMK treats keyboards that take an MCU addon board as [shields](https://docs.zephyrproject.org/2.3.0/guides/porting/shields.html), and treats the smaller MCU board as the true [board](https://docs.zephyrproject.org/2.3.0/guides/porting/board_porting.html)
|
||||
ZMK treats keyboards that take an MCU addon board as [shields](https://docs.zephyrproject.org/2.5.0/guides/porting/shields.html), and treats the smaller MCU board as the true [board](https://docs.zephyrproject.org/2.5.0/guides/porting/board_porting.html)
|
||||
|
||||
Given the following:
|
||||
|
||||
|
@ -47,7 +47,7 @@ west build -b proton_c -- -DSHIELD=kyria_left
|
|||
|
||||
### Keyboard With Onboard MCU
|
||||
|
||||
Keyboards with onboard MCU chips are simply treated as the [board](https://docs.zephyrproject.org/2.3.0/guides/porting/board_porting.html) as far as Zephyr™ is concerned.
|
||||
Keyboards with onboard MCU chips are simply treated as the [board](https://docs.zephyrproject.org/2.5.0/guides/porting/board_porting.html) as far as Zephyr™ is concerned.
|
||||
|
||||
Given the following:
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ The high level steps are:
|
|||
- Add support for features such as encoders, OLED displays, or RGB underglow.
|
||||
- Update build.yml
|
||||
|
||||
It may be helpful to review the upstream [shields documentation](https://docs.zephyrproject.org/2.3.0/guides/porting/shields.html#shields) to get a proper understanding of the underlying system before continuing.
|
||||
It may be helpful to review the upstream [shields documentation](https://docs.zephyrproject.org/2.5.0/guides/porting/shields.html#shields) to get a proper understanding of the underlying system before continuing.
|
||||
|
||||
:::note
|
||||
ZMK support for split keyboards requires a few more files than single boards to ensure proper connectivity between the central and peripheral units. Check the following guides thoroughly to ensure that all the files are in place.
|
||||
|
|
|
@ -205,9 +205,9 @@ The docker container includes `west` and the compilation toolchain. If you're us
|
|||
|
||||
### West Installation
|
||||
|
||||
`west` is the [Zephyr™ meta-tool](https://docs.zephyrproject.org/2.3.0/guides/west/index.html) used to configure and build Zephyr™ applications.
|
||||
`west` is the [Zephyr™ meta-tool](https://docs.zephyrproject.org/2.5.0/guides/west/index.html) used to configure and build Zephyr™ applications.
|
||||
|
||||
West can be installed by using the `pip` python package manager. The [Zephyr™ instructions](https://docs.zephyrproject.org/latest/guides/west/install.html#installing-west) are summarized here:
|
||||
West can be installed by using the `pip` python package manager. The [Zephyr™ instructions](https://docs.zephyrproject.org/2.5.0/guides/west/install.html#installing-west) are summarized here:
|
||||
|
||||
<Tabs
|
||||
defaultValue="linux"
|
||||
|
@ -280,10 +280,10 @@ platform.
|
|||
To build firmwares for the ARM architecture (all supported MCUs/keyboards at this point), you'll need to install the Zephyr™ ARM SDK to your system:
|
||||
|
||||
```
|
||||
export ZSDK_VERSION=0.11.4
|
||||
wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/zephyr-toolchain-arm-${ZSDK_VERSION}-setup.run" && \
|
||||
sh "zephyr-toolchain-arm-${ZSDK_VERSION}-setup.run" --quiet -- -d ~/.local/zephyr-sdk-${ZSDK_VERSION} && \
|
||||
rm "zephyr-toolchain-arm-${ZSDK_VERSION}-setup.run"
|
||||
export ZSDK_VERSION=0.12.4
|
||||
wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/zephyr-toolchain-arm-${ZSDK_VERSION}-x86_64-linux-setup.run" && \
|
||||
sh "zephyr-toolchain-arm-${ZSDK_VERSION}-x86_64-linux-setup.run" --quiet -- -d ~/.local/zephyr-sdk-${ZSDK_VERSION} && \
|
||||
rm "zephyr-toolchain-arm-${ZSDK_VERSION}-x86_64-linux-setup.run"
|
||||
```
|
||||
|
||||
The installation will prompt with several questions about installation location, and creating a default `~/.zephyrrc` for you with various variables. The defaults should normally work as expected.
|
||||
|
@ -292,7 +292,7 @@ The installation will prompt with several questions about installation location,
|
|||
<TabItem value="raspberryos">
|
||||
|
||||
Because Raspberry OS (Raspbian) runs on the same architecture (but different ABI) as the keyboard MCUs,
|
||||
the operating system's installed [cross compilers](https://docs.zephyrproject.org/2.3.0/getting_started/toolchain_other_x_compilers.html) can be used to target the different ABI.
|
||||
the operating system's installed [cross compilers](https://docs.zephyrproject.org/2.5.0/getting_started/toolchain_other_x_compilers.html) can be used to target the different ABI.
|
||||
|
||||
First, the cross compiler should be installed:
|
||||
|
||||
|
@ -315,10 +315,10 @@ export CROSS_COMPILE=/usr/bin/arm-none-eabi-
|
|||
To build firmwares for the ARM architecture (all supported MCUs/keyboards at this point), you'll need to install the Zephyr™ ARM SDK to your system:
|
||||
|
||||
```
|
||||
export ZSDK_VERSION=0.11.4
|
||||
wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/zephyr-toolchain-arm-${ZSDK_VERSION}-setup.run" && \
|
||||
sh "zephyr-toolchain-arm-${ZSDK_VERSION}-setup.run" --quiet -- -d ~/.local/zephyr-sdk-${ZSDK_VERSION} && \
|
||||
rm "zephyr-toolchain-arm-${ZSDK_VERSION}-setup.run"
|
||||
export ZSDK_VERSION=0.12.4
|
||||
wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/zephyr-toolchain-arm-${ZSDK_VERSION}-x86_64-linux-setup.run" && \
|
||||
sh "zephyr-toolchain-arm-${ZSDK_VERSION}-x86_64-linux-setup.run" --quiet -- -d ~/.local/zephyr-sdk-${ZSDK_VERSION} && \
|
||||
rm "zephyr-toolchain-arm-${ZSDK_VERSION}-x86_64-linux-setup.run"
|
||||
```
|
||||
|
||||
The installation will prompt with several questions about installation location, and creating a default `~/.zephyrrc` for you with various variables. The defaults should normally work as expected.
|
||||
|
@ -328,14 +328,14 @@ The installation will prompt with several questions about installation location,
|
|||
|
||||
#### GNU ARM Embedded
|
||||
|
||||
Since the Zephyr™ SDK is not available for Windows, we recommending following the [Zephyr documentation](https://docs.zephyrproject.org/2.3.0/getting_started/toolchain_3rd_party_x_compilers.html#gnu-arm-embedded) to install a GNU ARM Embedded build. Note the warnings regarding installing the toolchain into a path with spaces, and make sure to follow the steps to add the environment variables which are also summarized with screenshots in the [Environment Variables](#environment-variables) section below.
|
||||
Since the Zephyr™ SDK is not available for Windows, we recommending following the [Zephyr documentation](https://docs.zephyrproject.org/2.5.0/getting_started/toolchain_3rd_party_x_compilers.html#gnu-arm-embedded) to install a GNU ARM Embedded build. Note the warnings regarding installing the toolchain into a path with spaces, and make sure to follow the steps to add the environment variables which are also summarized with screenshots in the [Environment Variables](#environment-variables) section below.
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="mac">
|
||||
|
||||
#### GNU ARM Embedded
|
||||
|
||||
Since the Zephyr™ SDK is not available for macOS, we recommending following the steps to install the [GNU ARM Embedded](https://docs.zephyrproject.org/2.3.0/getting_started/toolchain_3rd_party_x_compilers.html#gnu-arm-embedded).
|
||||
Since the Zephyr™ SDK is not available for macOS, we recommending following the steps to install the [GNU ARM Embedded](https://docs.zephyrproject.org/2.5.0/getting_started/toolchain_3rd_party_x_compilers.html#gnu-arm-embedded).
|
||||
|
||||
The install command is:
|
||||
|
||||
|
@ -345,7 +345,7 @@ brew install --cask gcc-arm-embedded
|
|||
|
||||
:::warning Security Controls Workaround
|
||||
|
||||
Please be sure to read the [additional setup instructions](https://docs.zephyrproject.org/2.3.0/getting_started/installation_mac.html#mac-gatekeeper) needed to address security controls found in macOS 10.15 Catalina and newer
|
||||
Please be sure to read the [additional setup instructions](https://docs.zephyrproject.org/2.5.0/getting_started/installation_mac.html#mac-gatekeeper) needed to address security controls found in macOS 10.15 Catalina and newer
|
||||
|
||||
:::
|
||||
|
||||
|
@ -514,7 +514,7 @@ On Windows, only two environment variables need to be set for ZMK to build prope
|
|||
#### For Zephyr
|
||||
|
||||
By default, the Zephyr™ SDK will create a file named `~/.zephyrrc` with the correct environment variables to build ZMK.
|
||||
We suggest two main [options](https://docs.zephyrproject.org/2.3.0/guides/env_vars.html?highlight=zephyrrc) for how to load those settings.
|
||||
We suggest two main [options](https://docs.zephyrproject.org/2.5.0/guides/env_vars.html#option-3-using-zephyrrc-files) for how to load those settings.
|
||||
|
||||
##### Per Shell
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ That being said, there are currently only a few specific [boards](/docs/faq#what
|
|||
|
||||
## Boards
|
||||
|
||||
- [nice!nano](https://nicekeyboards.com/products/nice-nano-v1-0) (`nice_nano`)
|
||||
- [nice!nano](https://nicekeyboards.com/nice-nano) (`nice_nano`, `nice_nano_v2`)
|
||||
- [nrfMicro](https://github.com/joric/nrfmicro) (`nrfmicro_13`, `nrfmicro_11`, `nrfmicro_11_flipped`)
|
||||
- [BlueMicro840](https://store.jpconstantineau.com/#/group/bluemicro) (`bluemicro840_v1`)
|
||||
- [QMK Proton-C](https://qmk.fm/proton-c/) (`proton_c`)
|
||||
|
|
|
@ -37,7 +37,7 @@ export const zmkBase = {
|
|||
*/
|
||||
export const zmkBoards = {
|
||||
"nice!nano": {
|
||||
name: "nice!nano",
|
||||
name: "nice!nano v1",
|
||||
powerSupply: {
|
||||
type: "LDO",
|
||||
outputVoltage: 3.3,
|
||||
|
@ -45,6 +45,15 @@ export const zmkBoards = {
|
|||
},
|
||||
otherQuiescentMicroA: 4,
|
||||
},
|
||||
"nice!nano v2": {
|
||||
name: "nice!nano v2",
|
||||
powerSupply: {
|
||||
type: "LDO",
|
||||
outputVoltage: 3.3,
|
||||
quiescentMicroA: 15,
|
||||
},
|
||||
otherQuiescentMicroA: 3,
|
||||
},
|
||||
"nice!60": {
|
||||
powerSupply: {
|
||||
type: "SWITCHING",
|
||||
|
|
4
docs/static/setup.ps1
vendored
4
docs/static/setup.ps1
vendored
|
@ -75,8 +75,8 @@ $repo_path = "https://github.com/zmkfirmware/zmk-config-split-template.git"
|
|||
|
||||
$title = "ZMK Config Setup:"
|
||||
$prompt = "Pick an MCU board"
|
||||
$options = "nice!nano", "QMK Proton-C", "BlueMicro840 (v1)", "makerdiary nRF52840 M.2"
|
||||
$boards = "nice_nano", "proton_c", "bluemicro840_v1", "nrf52840_m2"
|
||||
$options = "nice!nano v1", "nice!nano v2", "QMK Proton-C", "BlueMicro840 (v1)", "makerdiary nRF52840 M.2"
|
||||
$boards = "nice_nano", "nice_nano_v2", "proton_c", "bluemicro840_v1", "nrf52840_m2"
|
||||
|
||||
Write-Host "$title"
|
||||
Write-Host ""
|
||||
|
|
9
docs/static/setup.sh
vendored
9
docs/static/setup.sh
vendored
|
@ -66,7 +66,7 @@ repo_path="https://github.com/zmkfirmware/zmk-config-split-template.git"
|
|||
title="ZMK Config Setup:"
|
||||
|
||||
prompt="Pick an MCU board:"
|
||||
options=("nice!nano" "QMK Proton-C" "BlueMicro840 (v1)" "makerdiary nRF52840 M.2")
|
||||
options=("nice!nano v1" "nice!nano v2" "QMK Proton-C" "BlueMicro840 (v1)" "makerdiary nRF52840 M.2")
|
||||
|
||||
echo "$title"
|
||||
echo ""
|
||||
|
@ -77,9 +77,10 @@ select opt in "${options[@]}" "Quit"; do
|
|||
case "$REPLY" in
|
||||
|
||||
1 ) board="nice_nano"; break;;
|
||||
2 ) board="proton_c"; break;;
|
||||
3 ) board="bluemicro840_v1"; break;;
|
||||
4 ) board="nrf52840_m2"; break;;
|
||||
2 ) board="nice_nano_v2" break;;
|
||||
3 ) board="proton_c"; break;;
|
||||
4 ) board="bluemicro840_v1"; break;;
|
||||
5 ) board="nrf52840_m2"; break;;
|
||||
|
||||
$(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit 1;;
|
||||
*) echo "Invalid option. Try another one."; continue;;
|
||||
|
|
Loading…
Add table
Reference in a new issue