Skip to content

Commit

Permalink
Clique changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFil committed Jan 11, 2025
1 parent ee455df commit f5f9b01
Show file tree
Hide file tree
Showing 8 changed files with 358 additions and 10 deletions.
60 changes: 58 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
container:
image: zmkfirmware/zmk-build-arm:stable
name: Build
name: Build (Legacy)
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -55,7 +55,63 @@ jobs:
- name: Archive (Adv360)
uses: actions/upload-artifact@v4
with:
name: firmware
name: firmware-no-clique
path: |
${{ steps.get_info.outputs.file_prefix }}-left.uf2
${{ steps.get_info.outputs.file_prefix }}-right.uf2
build-clique:
runs-on: ubuntu-latest
container:
image: zmkfirmware/zmk-build-arm:stable
name: Build (Clique)
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get version data
id: get_info
run: |
timestamp=$(date +"%Y%m%d%H%M")
commit=$(echo "${{ github.sha }}" | cut -c1-7)
file_prefix=$timestamp-$commit
branch_name=$(echo "${{ github.ref }}" | awk -F'/' '{print $3}' | cut -c1-4)
echo "file_prefix=$file_prefix" >> $GITHUB_OUTPUT
bin/get_version.sh $branch_name $commit clique
- name: Cache west modules
uses: actions/cache@v4
env:
cache-name: cache-zephyr-modules
with:
path: |
modules/
tools/
zephyr/
bootloader/
zmk/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('manifest-dir/west.yml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: West Init
run: west init -l config
- name: West Update
run: west update
- name: West Zephyr export
run: west zephyr-export
- name: West Build (left)
run: west build -s zmk/app -d build/left -b adv360_left -S studio-rpc-usb-uart -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/config -DCONFIG_ZMK_STUDIO=y"
- name: Adv360 Left Kconfig file
run: grep -vE '(^#|^$)' build/left/zephyr/.config
- name: West Build (right)
run: west build -s zmk/app -d build/right -b adv360_right -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
- name: Adv360 Right Kconfig file
run: grep -vE '(^#|^$)' build/right/zephyr/.config
- name: Rename zmk.uf2
run: cp build/left/zephyr/zmk.uf2 ${{ steps.get_info.outputs.file_prefix }}-left.uf2 && cp build/right/zephyr/zmk.uf2 ${{ steps.get_info.outputs.file_prefix }}-right.uf2
- name: Archive (Adv360)
uses: actions/upload-artifact@v4
with:
name: firmware-clique
path: |
${{ steps.get_info.outputs.file_prefix }}-left.uf2
${{ steps.get_info.outputs.file_prefix }}-right.uf2
13 changes: 11 additions & 2 deletions bin/get_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
date=$(date -u +"%Y%m%d")
branch=${1:-$(git rev-parse --abbrev-ref HEAD | cut -c1-4)}
commit=${2:-$(git rev-parse --short HEAD)}
clique=${3:-"."}

uppercase_char() {
local char=$1
Expand Down Expand Up @@ -48,8 +49,16 @@ for ((i = 0; i < ${#commit}; i++)); do
formatted_commit+=$(transform_char "${commit:$i:1}")
done

formatted_commit+="<&kp MINUS>, "

# Iterate over the clique string and format characters
formatted_clique=""
for ((i = 0; i < ${#clique}; i++)); do
formatted_clique+=$(transform_char "${commit:$i:1}")
done

# Combine the formatted string, add trailing carriage return
formatted_result="$formatted_date$formatted_branch$formatted_commit"
formatted_result="$formatted_date$formatted_branch$formatted_commit$formatted_clique"
formatted_result+="<&kp RET>"

echo $formatted_result
Expand All @@ -58,7 +67,7 @@ echo $formatted_result
echo '#define VERSION_MACRO' > "config/version.dtsi"
echo 'macro_ver: macro_ver {' >> "config/version.dtsi"
echo 'compatible = "zmk,behavior-macro";' >> "config/version.dtsi"
echo 'label = "macro_ver";' >> "config/version.dtsi"
echo 'display-name = "Version Macro";' >> "config/version.dtsi"
echo '#binding-cells = <0>;' >> "config/version.dtsi"
echo "bindings = $formatted_result;" >> "config/version.dtsi"
echo '};' >> "config/version.dtsi"
4 changes: 2 additions & 2 deletions config/adv360.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
bindings = <
&kp EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &tog 1 &mo 3 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS
&kp TAB &kp Q &kp W &kp E &kp R &kp T &none &none &kp Y &kp U &kp I &kp O &kp P &kp BSLH
&kp ESC &kp A &kp S &kp D &kp F &kp G &none &kp LCTRL &kp LALT &kp LGUI &kp RCTRL &none &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp ESC &kp A &kp S &kp D &kp F &kp G &none &studio_unlock &kp LALT &kp LGUI &kp RCTRL &none &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp HOME &kp PG_UP &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
&mo 2 &kp GRAVE &kp CAPS &kp LEFT &kp RIGHT &kp BSPC &kp DEL &kp END &kp PG_DN &kp ENTER &kp SPACE &kp UP &kp DOWN &kp LBKT &kp RBKT &mo 2
&mo 2 &kp GRAVE &kp CAPS &kp LEFT &kp RIGHT &macro_ver &kp DEL &kp END &kp PG_DN &kp ENTER &kp SPACE &kp UP &kp DOWN &kp LBKT &kp RBKT &mo 2
>;
};
keypad {
Expand Down
87 changes: 87 additions & 0 deletions config/boards/arm/adv360/adv360-layouts.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#include <physical_layouts.dtsi>

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

keys // w h x y rot rx ry
= <&key_physical_attrs 125 100 0 25 0 0 0>
, <&key_physical_attrs 100 100 125 25 0 0 0>
, <&key_physical_attrs 100 100 225 0 0 0 0>
, <&key_physical_attrs 100 100 325 0 0 0 0>
, <&key_physical_attrs 100 100 425 0 0 0 0>
, <&key_physical_attrs 100 100 525 0 0 0 0>
, <&key_physical_attrs 100 100 625 0 0 0 0>
, <&key_physical_attrs 100 100 1075 0 0 0 0>
, <&key_physical_attrs 100 100 1175 0 0 0 0>
, <&key_physical_attrs 100 100 1275 0 0 0 0>
, <&key_physical_attrs 100 100 1375 0 0 0 0>
, <&key_physical_attrs 100 100 1475 0 0 0 0>
, <&key_physical_attrs 100 100 1575 25 0 0 0>
, <&key_physical_attrs 125 100 1675 25 0 0 0>
, <&key_physical_attrs 125 100 0 125 0 0 0>
, <&key_physical_attrs 100 100 125 125 0 0 0>
, <&key_physical_attrs 100 100 225 100 0 0 0>
, <&key_physical_attrs 100 100 325 100 0 0 0>
, <&key_physical_attrs 100 100 425 100 0 0 0>
, <&key_physical_attrs 100 100 525 100 0 0 0>
, <&key_physical_attrs 100 100 625 100 0 0 0>
, <&key_physical_attrs 100 100 1075 100 0 0 0>
, <&key_physical_attrs 100 100 1175 100 0 0 0>
, <&key_physical_attrs 100 100 1275 100 0 0 0>
, <&key_physical_attrs 100 100 1375 100 0 0 0>
, <&key_physical_attrs 100 100 1475 100 0 0 0>
, <&key_physical_attrs 100 100 1575 125 0 0 0>
, <&key_physical_attrs 125 100 1675 125 0 0 0>
, <&key_physical_attrs 125 100 0 225 0 0 0>
, <&key_physical_attrs 100 100 125 225 0 0 0>
, <&key_physical_attrs 100 100 225 200 0 0 0>
, <&key_physical_attrs 100 100 325 200 0 0 0>
, <&key_physical_attrs 100 100 425 200 0 0 0>
, <&key_physical_attrs 100 100 525 200 0 0 0>
, <&key_physical_attrs 100 100 625 200 0 0 0>
, <&key_physical_attrs 100 100 675 400 1500 525 400>
, <&key_physical_attrs 100 100 775 400 1500 525 400>
, <&key_physical_attrs 100 100 925 400 (-1500) 1275 400>
, <&key_physical_attrs 100 100 1025 400 (-1500) 1275 400>
, <&key_physical_attrs 100 100 1075 200 0 0 0>
, <&key_physical_attrs 100 100 1175 200 0 0 0>
, <&key_physical_attrs 100 100 1275 200 0 0 0>
, <&key_physical_attrs 100 100 1375 200 0 0 0>
, <&key_physical_attrs 100 100 1475 200 0 0 0>
, <&key_physical_attrs 100 100 1575 225 0 0 0>
, <&key_physical_attrs 125 100 1675 225 0 0 0>
, <&key_physical_attrs 125 100 0 325 0 0 0>
, <&key_physical_attrs 100 100 125 325 0 0 0>
, <&key_physical_attrs 100 100 225 300 0 0 0>
, <&key_physical_attrs 100 100 325 300 0 0 0>
, <&key_physical_attrs 100 100 425 300 0 0 0>
, <&key_physical_attrs 100 100 525 300 0 0 0>
, <&key_physical_attrs 100 100 775 500 1500 525 400>
, <&key_physical_attrs 100 100 925 500 (-1500) 1275 400>
, <&key_physical_attrs 100 100 1175 300 0 0 0>
, <&key_physical_attrs 100 100 1275 300 0 0 0>
, <&key_physical_attrs 100 100 1375 300 0 0 0>
, <&key_physical_attrs 100 100 1475 300 0 0 0>
, <&key_physical_attrs 100 100 1575 325 0 0 0>
, <&key_physical_attrs 125 100 1675 325 0 0 0>
, <&key_physical_attrs 125 100 0 425 0 0 0>
, <&key_physical_attrs 100 100 125 425 0 0 0>
, <&key_physical_attrs 100 100 225 400 0 0 0>
, <&key_physical_attrs 100 100 325 400 0 0 0>
, <&key_physical_attrs 100 100 425 400 0 0 0>
, <&key_physical_attrs 100 200 575 500 1500 525 400>
, <&key_physical_attrs 100 200 675 500 1500 525 400>
, <&key_physical_attrs 100 100 775 600 1500 525 400>
, <&key_physical_attrs 100 100 925 600 (-1500) 1275 400>
, <&key_physical_attrs 100 200 1025 500 (-1500) 1275 400>
, <&key_physical_attrs 100 200 1125 500 (-1500) 1275 400>
, <&key_physical_attrs 100 100 1275 400 0 0 0>
, <&key_physical_attrs 100 100 1375 400 0 0 0>
, <&key_physical_attrs 100 100 1475 400 0 0 0>
, <&key_physical_attrs 100 100 1575 425 0 0 0>
, <&key_physical_attrs 125 100 1675 425 0 0 0>
;
};
};
9 changes: 7 additions & 2 deletions config/boards/arm/adv360/adv360.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@
#include <dt-bindings/led/led.h>
#include <dt-bindings/zmk/matrix_transform.h>

#include "adv360-layouts.dtsi"
#include "adv360_pinctrl.dtsi"

&physical_layout0 {
transform = <&matrix_transform0>;
};

/ {
model = "Adv360";
compatible = "kinesis,adv360";
Expand All @@ -25,11 +30,11 @@
zmk,kscan = &kscan0;
zmk,backlight = &backlight;
zmk,battery = &vbatt;
zmk,matrix_transform = &default_transform;
zmk,physical-layout = &physical_layout0;
zmk,underglow = &led_strip;
};

default_transform: keymap_transform_0 {
matrix_transform0: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <20>;
rows = <5>;
Expand Down
4 changes: 3 additions & 1 deletion config/boards/arm/adv360/adv360_left_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,6 @@ CONFIG_ZMK_BLE_PASSKEY_ENTRY=n

CONFIG_ZMK_BLE=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_HID_INDICATORS=y
CONFIG_ZMK_HID_INDICATORS=y

CONFIG_ZMK_BEHAVIOR_LOCAL_ID_TYPE_CRC16=y
2 changes: 1 addition & 1 deletion config/boards/arm/adv360/adv360_right.dts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
};
};

&default_transform {
&matrix_transform0 {
col-offset = <10>;
};
Loading

0 comments on commit f5f9b01

Please sign in to comment.