Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ jobs:
--arg branch "$VERSION_BRANCH" \
--arg digest "$digest" \
--arg api_version "$api_version" \
--argjson boards '["glove80", "go60"]' \
> "/tmp/$VERSION_NAME.json"
- name: Upload image metadata file to versions bucket
run: aws s3 cp "/tmp/$VERSION_NAME.json" "s3://$VERSIONS_BUCKET/images/$VERSION_NAME.json"
Expand Down
27 changes: 18 additions & 9 deletions .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Glove80 Firmware
name: Build Firmware

on:
push:
Expand All @@ -20,8 +20,13 @@ on:

jobs:
build:
name: Build Glove80 Firmware
name: Build Firmware
runs-on: ubuntu-latest
strategy:
matrix:
board:
- glove80
- go60
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
Expand All @@ -32,15 +37,15 @@ jobs:
name: moergo-glove80-zmk-dev
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
skipPush: "${{ github.repository != 'moergo-sc/zmk' }}"
- name: Build Glove80 combined firmware
run: nix-build -A glove80_combined -o combined
- name: Build ${{ matrix.board }} combined firmware
run: nix-build -A ${{matrix.board}}_combined -o combined
- name: Copy result out of nix store
run: cp combined/glove80.uf2 glove80.uf2
run: cp combined/${{matrix.board}}.uf2 ${{matrix.board}}.uf2
- name: Upload result
uses: actions/upload-artifact@v4
with:
name: glove80.uf2
path: glove80.uf2
name: ${{matrix.board}}.uf2
path: ${{matrix.board}}.uf2
release:
name: Create Release for Tag
if: >-
Expand All @@ -50,13 +55,17 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download compiled firmware artifact
- name: Download Glove80 firmware artifact
uses: actions/download-artifact@v4
with:
name: glove80.uf2
- name: Download Go60 firmware artifact
uses: actions/download-artifact@v4
with:
name: go60.uf2
- name: Create Release for Tag
uses: ncipollo/release-action@v1
with:
artifacts: "glove80.uf2"
artifacts: "glove80.uf2,go60.uf2"
artifactErrorsFailBuild: true
generateReleaseNotes: true
21 changes: 16 additions & 5 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ target_sources(app PRIVATE src/events/sensor_event.c)
target_sources_ifdef(CONFIG_ZMK_WPM app PRIVATE src/events/wpm_state_changed.c)
target_sources_ifdef(CONFIG_USB_DEVICE_STACK app PRIVATE src/events/usb_conn_state_changed.c)
target_sources(app PRIVATE src/behaviors/behavior_reset.c)
target_sources(app PRIVATE src/behaviors/behavior_transparent.c)
target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/behaviors/behavior_ext_power.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SOFT_OFF app PRIVATE src/behaviors/behavior_soft_off.c)
add_subdirectory_ifdef(CONFIG_ZMK_POINTING src/pointing/)
Expand All @@ -58,7 +59,6 @@ if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
target_sources(app PRIVATE src/behaviors/behavior_outputs.c)
target_sources(app PRIVATE src/behaviors/behavior_toggle_layer.c)
target_sources(app PRIVATE src/behaviors/behavior_to_layer.c)
target_sources(app PRIVATE src/behaviors/behavior_transparent.c)
target_sources(app PRIVATE src/behaviors/behavior_none.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SENSOR_ROTATE app PRIVATE src/behaviors/behavior_sensor_rotate.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SENSOR_ROTATE_VAR app PRIVATE src/behaviors/behavior_sensor_rotate_var.c)
Expand All @@ -71,36 +71,47 @@ if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
target_sources(app PRIVATE src/behavior_queue.c)
target_sources(app PRIVATE src/conditional_layer.c)
target_sources(app PRIVATE src/endpoints.c)
target_sources(app PRIVATE src/events/endpoint_changed.c)
target_sources(app PRIVATE src/hid_listener.c)
target_sources(app PRIVATE src/keymap.c)
target_sources(app PRIVATE src/events/layer_state_changed.c)
target_sources(app PRIVATE src/events/modifiers_state_changed.c)
target_sources(app PRIVATE src/events/keycode_state_changed.c)
target_sources_ifdef(CONFIG_ZMK_HID_INDICATORS app PRIVATE src/hid_indicators.c)

if (CONFIG_ZMK_BLE)
target_sources(app PRIVATE src/events/ble_active_profile_changed.c)
target_sources(app PRIVATE src/behaviors/behavior_bt.c)
target_sources(app PRIVATE src/ble.c)
target_sources(app PRIVATE src/hog.c)
endif()
endif()

target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/behaviors/behavior_rgb_underglow.c)
target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/behaviors/behavior_underglow_color.c)
if (CONFIG_ZMK_HID_INDICATORS)
target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/behaviors/behavior_underglow_indicators.c)
endif()
target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/behaviors/behavior_underglow_battery.c)
target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/events/underglow_color_changed.c)
target_sources_ifdef(CONFIG_ZMK_BACKLIGHT app PRIVATE src/behaviors/behavior_backlight.c)

target_sources_ifdef(CONFIG_ZMK_BATTERY_REPORTING app PRIVATE src/events/battery_state_changed.c)
target_sources_ifdef(CONFIG_ZMK_BATTERY_REPORTING app PRIVATE src/battery.c)

target_sources_ifdef(CONFIG_ZMK_HID_INDICATORS app PRIVATE src/events/hid_indicators_changed.c)

target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/events/ble_active_profile_changed.c)


target_sources(app PRIVATE src/events/layer_state_changed.c)
target_sources(app PRIVATE src/events/modifiers_state_changed.c)
target_sources(app PRIVATE src/events/endpoint_changed.c)

target_sources_ifdef(CONFIG_ZMK_SPLIT app PRIVATE src/events/split_peripheral_status_changed.c)
target_sources_ifdef(CONFIG_ZMK_SPLIT app PRIVATE src/events/split_peripheral_layer_changed.c)
add_subdirectory_ifdef(CONFIG_ZMK_SPLIT src/split)

target_sources_ifdef(CONFIG_USB_DEVICE_STACK app PRIVATE src/usb.c)
target_sources_ifdef(CONFIG_ZMK_USB app PRIVATE src/usb_hid.c)
target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/rgb_underglow.c)
target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/rgb_underglow_layer.c)
target_sources_ifdef(CONFIG_ZMK_BACKLIGHT app PRIVATE src/backlight.c)
target_sources_ifdef(CONFIG_ZMK_LOW_PRIORITY_WORK_QUEUE app PRIVATE src/workqueue.c)
target_sources(app PRIVATE src/main.c)
Expand Down
4 changes: 4 additions & 0 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ config ZMK_RGB_UNDERGLOW_AUTO_OFF_USB
bool "Turn off RGB underglow when USB is disconnected"
depends on USB_DEVICE_STACK

config EXPERIMENTAL_RGB_LAYER
bool "Experimental per-key per-layer RGB underglow"
default n

endif # ZMK_RGB_UNDERGLOW

menuconfig ZMK_BACKLIGHT
Expand Down
9 changes: 9 additions & 0 deletions app/boards/arm/glove80/glove80_lh.dts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
zmk,underglow-indicators = &underglow_indicators;
};

underglow-layer {
compatible = "zmk,underglow-layer";
pixel-lookup =
<52>, <53>, <54>, <69>, <70>, <71>, <15>, <27>, <39>, <51>, <4>, <14>, <26>, <38>,
<50>, <68>, <3>, <13>, <25>, <37>, <49>, <67>, <2>, <12>, <24>, <36>, <48>, <66>,
<1>, <11>, <23>, <35>, <47>, <65>, <0>, <10>, <22>, <34>, <46>, <64>;
};


back_led_backlight: pwmleds {
compatible = "pwm-leds";
pwm_led_0 {
Expand Down
3 changes: 3 additions & 0 deletions app/boards/arm/glove80/glove80_lh_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ CONFIG_ZMK_HID_CONSUMER_REPORT_USAGES_BASIC=y
CONFIG_ZMK_USB_BOOT=y
CONFIG_ZMK_HID_INDICATORS=y

# Send HID indicator to peripherals
CONFIG_ZMK_SPLIT_PERIPHERAL_HID_INDICATORS=y

# Turn on debugging to disable optimization. Debug messages can result in larger
# stacks, so enable stack protection and particularly a larger BLE peripheral stack.
# CONFIG_DEBUG=y
Expand Down
9 changes: 9 additions & 0 deletions app/boards/arm/glove80/glove80_rh.dts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
zmk,battery = &vbatt;
};

underglow-layer {
compatible = "zmk,underglow-layer";
pixel-lookup =
<57>, <56>, <55>, <74>, <73>, <72>, <16>, <28>, <40>, <58>, <5>, <17>, <29>, <41>,
<59>, <75>, <6>, <18>, <30>, <42>, <60>, <76>, <7>, <19>, <31>, <43>, <61>, <77>,
<8>, <20>, <32>, <44>, <62>, <78>, <9>, <21>, <33>, <45>, <63>, <79>;
};


back_led_backlight: pwmleds {
compatible = "pwm-leds";
pwm_led_0 {
Expand Down
4 changes: 4 additions & 0 deletions app/boards/arm/glove80/glove80_rh_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=285
CONFIG_ZMK_RGB_UNDERGLOW_SAT_START=75
CONFIG_ZMK_RGB_UNDERGLOW_BRT_START=16

# Enable HID indicators on peripheral
CONFIG_ZMK_HID_INDICATORS=y
CONFIG_ZMK_SPLIT_PERIPHERAL_HID_INDICATORS=y

# The power LED is implemented as a backlight
# For now, the power LED is acting as a "USB connected" indicator
CONFIG_ZMK_BACKLIGHT=y
Expand Down
3 changes: 3 additions & 0 deletions app/boards/arm/go60/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
zephyr_library()
zephyr_library_sources(usb_serial_number.c)
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
8 changes: 8 additions & 0 deletions app/boards/arm/go60/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT

config BOARD_ENABLE_DCDC
bool "Enable DCDC mode"
select SOC_DCDC_NRF52X
default y
depends on (BOARD_GO60_LH || BOARD_GO60_RH)
10 changes: 10 additions & 0 deletions app/boards/arm/go60/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT

config BOARD_GO60_LH
bool "Go60 LH"
depends on SOC_NRF52840_QIAA

config BOARD_GO60_RH
bool "Go60 RH"
depends on SOC_NRF52840_QIAA
77 changes: 77 additions & 0 deletions app/boards/arm/go60/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT

if BOARD_GO60_LH

config BOARD
default "go60 lh"

config ZMK_SPLIT_ROLE_CENTRAL
default y

endif # BOARD_GO60_LH

if BOARD_GO60_RH

config BOARD
default "go60 rh"

endif # BOARD_GO60_RH

if BOARD_GO60_LH || BOARD_GO60_RH

config UART_0_INTERRUPT_DRIVEN
depends on !ZMK_SPLIT_WIRED_UART_MODE_ASYNC

config ZMK_SPLIT
default y

config ZMK_POINTING
default y

config ZMK_POINTING_SMOOTH_SCROLLING
default n

config ZMK_IDLE_TIMEOUT
default 120000

config BT_CTLR
default BT

config ZMK_KSCAN_MATRIX_WAIT_BETWEEN_OUTPUTS
default 5

config PINCTRL
default y

if USB

config USB_NRFX
default y

config USB_DEVICE_STACK
default y

endif # USB

if ZMK_BACKLIGHT

config PWM
default y

config LED_PWM
default y

endif # ZMK_BACKLIGHT

if ZMK_RGB_UNDERGLOW

config SPI
default y

config WS2812_STRIP
default y

endif # ZMK_RGB_UNDERGLOW

endif # BOARD_GO60_LH || BOARD_GO60_RH
6 changes: 6 additions & 0 deletions app/boards/arm/go60/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT

board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
74 changes: 74 additions & 0 deletions app/boards/arm/go60/go60-layouts.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#include <physical_layouts.dtsi>

/ {
physical_layout0: physical_layout_0 {
compatible = "zmk,physical-layout";
display-name = "Default";

kscan = <&kscan0>;
transform = <&matrix_transform0>;

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 50 0 0 0>
, <&key_physical_attrs 100 100 100 50 0 0 0>
, <&key_physical_attrs 100 100 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 400 0 0 0 0>
, <&key_physical_attrs 100 100 500 0 0 0 0>
, <&key_physical_attrs 100 100 1150 0 0 0 0>
, <&key_physical_attrs 100 100 1250 0 0 0 0>
, <&key_physical_attrs 100 100 1350 0 0 0 0>
, <&key_physical_attrs 100 100 1450 0 0 0 0>
, <&key_physical_attrs 100 100 1550 50 0 0 0>
, <&key_physical_attrs 100 100 1650 50 0 0 0>
, <&key_physical_attrs 100 100 0 150 0 0 0>
, <&key_physical_attrs 100 100 100 150 0 0 0>
, <&key_physical_attrs 100 100 200 100 0 0 0>
, <&key_physical_attrs 100 100 300 100 0 0 0>
, <&key_physical_attrs 100 100 400 100 0 0 0>
, <&key_physical_attrs 100 100 500 100 0 0 0>
, <&key_physical_attrs 100 100 1150 100 0 0 0>
, <&key_physical_attrs 100 100 1250 100 0 0 0>
, <&key_physical_attrs 100 100 1350 100 0 0 0>
, <&key_physical_attrs 100 100 1450 100 0 0 0>
, <&key_physical_attrs 100 100 1550 150 0 0 0>
, <&key_physical_attrs 100 100 1650 150 0 0 0>
, <&key_physical_attrs 100 100 0 250 0 0 0>
, <&key_physical_attrs 100 100 100 250 0 0 0>
, <&key_physical_attrs 100 100 200 200 0 0 0>
, <&key_physical_attrs 100 100 300 200 0 0 0>
, <&key_physical_attrs 100 100 400 200 0 0 0>
, <&key_physical_attrs 100 100 500 200 0 0 0>
, <&key_physical_attrs 100 100 1150 200 0 0 0>
, <&key_physical_attrs 100 100 1250 200 0 0 0>
, <&key_physical_attrs 100 100 1350 200 0 0 0>
, <&key_physical_attrs 100 100 1450 200 0 0 0>
, <&key_physical_attrs 100 100 1550 250 0 0 0>
, <&key_physical_attrs 100 100 1650 250 0 0 0>
, <&key_physical_attrs 100 100 0 350 0 0 0>
, <&key_physical_attrs 100 100 100 350 0 0 0>
, <&key_physical_attrs 100 100 200 300 0 0 0>
, <&key_physical_attrs 100 100 300 300 0 0 0>
, <&key_physical_attrs 100 100 400 300 0 0 0>
, <&key_physical_attrs 100 100 500 300 0 0 0>
, <&key_physical_attrs 100 100 1150 300 0 0 0>
, <&key_physical_attrs 100 100 1250 300 0 0 0>
, <&key_physical_attrs 100 100 1350 300 0 0 0>
, <&key_physical_attrs 100 100 1450 300 0 0 0>
, <&key_physical_attrs 100 100 1550 350 0 0 0>
, <&key_physical_attrs 100 100 1650 350 0 0 0>
, <&key_physical_attrs 100 100 200 400 0 0 0>
, <&key_physical_attrs 100 100 300 400 0 0 0>
, <&key_physical_attrs 100 100 400 400 0 0 0>
, <&key_physical_attrs 100 100 520 410 1250 520 410>
, <&key_physical_attrs 100 100 640 440 2500 640 440>
, <&key_physical_attrs 100 100 750 495 3700 750 495>
, <&key_physical_attrs 100 100 915 550 (-3700) 915 550>
, <&key_physical_attrs 100 100 1015 480 (-2500) 1015 480>
, <&key_physical_attrs 100 100 1130 430 (-1250) 1130 430>
, <&key_physical_attrs 100 100 1250 400 0 0 0>
, <&key_physical_attrs 100 100 1350 400 0 0 0>
, <&key_physical_attrs 100 100 1450 400 0 0 0>
;
};
};
Loading