Skip to content

Commit

Permalink
add zmk studio support
Browse files Browse the repository at this point in the history
  • Loading branch information
tokyo2006 committed Dec 11, 2024
1 parent 76bdacf commit 96a6efa
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 25 deletions.
20 changes: 2 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,9 @@ name: Build ZMK firmware
on:
workflow_dispatch:
push:
paths:
- "config/**"
paths-ignore:
- "keymap-drawer/**"

jobs:
build:
uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main
draw:
uses: caksoylar/keymap-drawer/.github/workflows/draw-zmk.yml@main
permissions:
contents: write
with:
commit_message: "[Draw] ${{ github.event.head_commit.message }}"
amend_commit: false
install_branch: "main"
keymap_patterns: "config/*.keymap"
json_path: "config"
config_path: "keymap_drawer.config.yaml" # config file, ignored if not exists
output_folder: "keymap-drawer"
destination: "both"
parse_args: "" # map of extra args to pass to `keymap parse`, e.g. "corne:'-l Def Lwr Rse' cradio:''"
draw_args: "" # map of extra args to pass to `keymap draw`, e.g. "corne:'-k corne_rotated' cradio:'-k paroxysm'"

18 changes: 18 additions & 0 deletions .github/workflows/draw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Draw Keymap
on:
workflow_dispatch:
push:
paths:
- "config/**"
- .github/workflows/draw.yml
- keymap_drawer.config.yaml

jobs:
draw:
uses: caksoylar/keymap-drawer/.github/workflows/draw-zmk.yml@main
permissions:
contents: write
with:
commit_message: "[Draw] ${{ github.event.head_commit.message }}"
destination: "commit"
fail_on_error: ${{ fromJSON(true) }}
5 changes: 5 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ include:
- board: corne_right
shield: nice_view_adapter nice_view_custom
artifact-name: corne_right_nice_view
- board: corne_left
shield: nice_view
snippet: studio-rpc-usb-uart
cmake-args: -DCONFIG_ZMK_STUDIO=y -DCONFIG_ZMK_STUDIO_LOCKING=n
artifact-name: eyelash_corne_studio_left
61 changes: 61 additions & 0 deletions config/boards/arm/corne/corne-layouts.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#include <physical_layouts.dtsi>

/ {
corne_layout: corne_layout {
compatible = "zmk,physical-layout";
display-name = "Layout";

transform = <&default_transform>;

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 88 0 0 0>
, <&key_physical_attrs 100 100 100 88 0 0 0>
, <&key_physical_attrs 100 100 200 50 0 0 0>
, <&key_physical_attrs 100 100 300 38 0 0 0>
, <&key_physical_attrs 100 100 400 50 0 0 0>
, <&key_physical_attrs 100 100 500 75 0 0 0>
, <&key_physical_attrs 100 100 775 0 0 0 0>
, <&key_physical_attrs 100 100 1050 75 0 0 0>
, <&key_physical_attrs 100 100 1150 50 0 0 0>
, <&key_physical_attrs 100 100 1250 38 0 0 0>
, <&key_physical_attrs 100 100 1350 50 0 0 0>
, <&key_physical_attrs 100 100 1450 88 0 0 0>
, <&key_physical_attrs 100 100 1550 88 0 0 0>
, <&key_physical_attrs 100 100 0 188 0 0 0>
, <&key_physical_attrs 100 100 100 188 0 0 0>
, <&key_physical_attrs 100 100 200 150 0 0 0>
, <&key_physical_attrs 100 100 300 138 0 0 0>
, <&key_physical_attrs 100 100 400 150 0 0 0>
, <&key_physical_attrs 100 100 500 175 0 0 0>
, <&key_physical_attrs 100 100 775 200 0 0 0>
, <&key_physical_attrs 100 100 1050 175 0 0 0>
, <&key_physical_attrs 100 100 1150 150 0 0 0>
, <&key_physical_attrs 100 100 1250 138 0 0 0>
, <&key_physical_attrs 100 100 1350 150 0 0 0>
, <&key_physical_attrs 100 100 1450 188 0 0 0>
, <&key_physical_attrs 100 100 1550 188 0 0 0>
, <&key_physical_attrs 100 100 0 288 0 0 0>
, <&key_physical_attrs 100 100 100 288 0 0 0>
, <&key_physical_attrs 100 100 200 250 0 0 0>
, <&key_physical_attrs 100 100 300 238 0 0 0>
, <&key_physical_attrs 100 100 400 250 0 0 0>
, <&key_physical_attrs 100 100 500 275 0 0 0>
, <&key_physical_attrs 100 100 675 100 0 0 0>
, <&key_physical_attrs 100 100 1050 275 0 0 0>
, <&key_physical_attrs 100 100 1150 250 0 0 0>
, <&key_physical_attrs 100 100 1250 238 0 0 0>
, <&key_physical_attrs 100 100 1350 250 0 0 0>
, <&key_physical_attrs 100 100 1450 288 0 0 0>
, <&key_physical_attrs 100 100 1550 288 0 0 0>
, <&key_physical_attrs 100 100 650 325 0 0 0>
, <&key_physical_attrs 100 100 400 400 0 0 0>
, <&key_physical_attrs 100 100 550 400 3000 500 400>
, <&key_physical_attrs 100 150 675 350 3000 500 400>
, <&key_physical_attrs 100 100 875 100 0 0 0>
, <&key_physical_attrs 100 150 875 350 (-3000) 1150 400>
, <&key_physical_attrs 100 100 1000 400 (-3000) 1150 400>
, <&key_physical_attrs 100 100 1150 400 0 0 0>
, <&key_physical_attrs 100 100 775 100 0 0 0>
;
};
};
7 changes: 4 additions & 3 deletions config/boards/arm/corne/corne.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
#include <nordic/nrf52840_qiaa.dtsi>
#include <dt-bindings/led/led.h>
#include <dt-bindings/zmk/matrix_transform.h>
#include "corne-layouts.dtsi"

/ {
model = "corne";
compatible = "corne";
compatible = "peripherals,corne";

chosen {
zephyr,code-partition = &code_partition;
Expand All @@ -22,7 +23,7 @@
zephyr,display = &oled;
zephyr,console = &cdc_acm_uart;
zmk,underglow = &led_strip;
zmk,matrix-transform = &default_transform;
zmk,physical-layout = &corne_layout;
};

left_encoder: encoder_left {
Expand Down Expand Up @@ -186,4 +187,4 @@

color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
};
4 changes: 2 additions & 2 deletions config/boards/arm/corne/corne_left.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
wakeup-source;
diode-direction = "col2row";
row-gpios
= <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
Expand Down Expand Up @@ -52,4 +52,4 @@
a-gpios = <&gpio1 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio1 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
status = "okay";
};
};
2 changes: 1 addition & 1 deletion config/boards/arm/corne/corne_right.dts
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@

color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
};
2 changes: 1 addition & 1 deletion config/west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ manifest:
projects:
- name: zmk
remote: zmkfirmware
revision: feat/pointers-move-scroll
revision: feat/pointers-with-input-processors
import: app/west.yml
- name: mario-peripheral-animation
remote: gpeye
Expand Down

0 comments on commit 96a6efa

Please sign in to comment.