Skip to content

Commit 089ccc3

Browse files
ReFilRayJameson
authored andcommitted
Clique and mouse movement update (KinesisCorporation#630)
* Target new branch * Enable mouse emulation * Clique changes Update adv360.keymap Add unlock behavior to keymap * Improve light behavior * Update CHANGELOG.md * Add Layer names, extra clique layers * Update adv360.keymap * Add clique local building * Add predefined Studio macros * Change to new battery command * Update get_version.sh * Make &kscan0 a wakeup source * New layer names * Update CHANGELOG.md
1 parent ce2f30d commit 089ccc3

File tree

16 files changed

+722
-62
lines changed

16 files changed

+722
-62
lines changed

.github/workflows/build.yml

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
container:
99
image: zmkfirmware/zmk-build-arm:stable
10-
name: Build
10+
name: Build (Legacy)
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v4
@@ -55,7 +55,63 @@ jobs:
5555
- name: Archive (Adv360)
5656
uses: actions/upload-artifact@v4
5757
with:
58-
name: firmware
58+
name: firmware-no-clique
5959
path: |
6060
${{ steps.get_info.outputs.file_prefix }}-left.uf2
6161
${{ steps.get_info.outputs.file_prefix }}-right.uf2
62+
build-clique:
63+
runs-on: ubuntu-latest
64+
container:
65+
image: zmkfirmware/zmk-build-arm:stable
66+
name: Build (Clique)
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@v4
70+
- name: Get version data
71+
id: get_info
72+
run: |
73+
timestamp=$(date +"%Y%m%d%H%M")
74+
commit=$(echo "${{ github.sha }}" | cut -c1-7)
75+
file_prefix=$timestamp-$commit
76+
branch_name=$(echo "${{ github.ref }}" | awk -F'/' '{print $3}' | cut -c1-4)
77+
echo "file_prefix=$file_prefix" >> $GITHUB_OUTPUT
78+
bin/get_version.sh $branch_name $commit clique
79+
- name: Cache west modules
80+
uses: actions/cache@v4
81+
env:
82+
cache-name: cache-zephyr-modules
83+
with:
84+
path: |
85+
modules/
86+
tools/
87+
zephyr/
88+
bootloader/
89+
zmk/
90+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('manifest-dir/west.yml') }}
91+
restore-keys: |
92+
${{ runner.os }}-build-${{ env.cache-name }}-
93+
${{ runner.os }}-build-
94+
${{ runner.os }}-
95+
- name: West Init
96+
run: west init -l config
97+
- name: West Update
98+
run: west update
99+
- name: West Zephyr export
100+
run: west zephyr-export
101+
- name: West Build (left)
102+
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
103+
- name: Adv360 Left Kconfig file
104+
run: grep -vE '(^#|^$)' build/left/zephyr/.config
105+
- name: West Build (right)
106+
run: west build -s zmk/app -d build/right -b adv360_right -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
107+
- name: Adv360 Right Kconfig file
108+
run: grep -vE '(^#|^$)' build/right/zephyr/.config
109+
- name: Rename zmk.uf2
110+
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
111+
- name: Archive (Adv360)
112+
uses: actions/upload-artifact@v4
113+
with:
114+
name: firmware-clique
115+
path: |
116+
${{ steps.get_info.outputs.file_prefix }}-left.uf2
117+
${{ steps.get_info.outputs.file_prefix }}-right.uf2

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Here's all notable changes and commits to both the configuration repo and the ba
44
Many thanks to all those who have submitted issues and pull requests to make this firmware better!
55
## Config repo
66

7+
2/6/2025 - Update base ZMK, add changes to support Kinesis Clique, update RGB parameters and enable pointing support [#630](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/630)
8+
79
11/27/2024 - Fix misattributed PR link in changelog [#590](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/590)
810

911
4/16/2024 - Fix changelog dates [#448](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/448)
@@ -119,7 +121,32 @@ There have beeen 5 branches of ZMK used for the 360 Pro so far. Beta branches ar
119121
| [adv360-z3.2](https://github.com/ReFil/zmk/tree/adv360-z3.2) | 7/6/2023 | 20/10/2023 | [V3.0](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/tree/V3.0) (Up to commit 82494e7) |
120122
| [adv360-z3.2-2](https://github.com/ReFil/zmk/tree/adv360-z3.2-2) | 20/10/2023 | 1/14/2024 | [V3.0](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/tree/V3.0) (Up to commit 4a5003a) |
121123
| [adv360-z3.2-3](https://github.com/ReFil/zmk/tree/adv360-z3.2-3) | 1/14/2024 | 4/5/2024 | [V3.0](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/tree/V3.0) (Up to commit 742d19e) |
122-
| [adv360-z3.5](https://github.com/ReFil/zmk/tree/adv360-z3.5) | 4/5/2024 | To date | [V3.0](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/tree/V3.0) (Current) |
124+
| [adv360-z3.5](https://github.com/ReFil/zmk/tree/adv360-z3.5) | 4/5/2024 | 2/6/2025 | [V3.0](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/tree/V3.0) (Up to commit 8988c99) |
125+
| [adv360-z3.5-2](https://github.com/ReFil/zmk/tree/adv360-z3.5-2) | 2/6/2025 | To Date | [V3.0](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/tree/V3.0) (Current) |
126+
127+
### adv360-z3.5-2
128+
129+
1/26/2025 - Change mouse key press metadata to suit clique
130+
131+
1/25/2025 - Add new battery indication behavior
132+
133+
1/22/2025 - Send RGB effect over to the peripheral
134+
135+
1/14/2025 - Prevent ext power from saving to flash
136+
137+
1/14/2025 - Transmit RGB "on" state over the bluetooth connection
138+
139+
1/13/2025 - Add metadata to mouse button behaivior
140+
141+
1/11/2025 - Prevent RGB handler saving to flash
142+
143+
1/11/2025 - Changes to fix building after rebase
144+
145+
1/4/2025 - Rebase to latest ZMK (commit 3377ed02)
146+
147+
11/21/2024 - Add additional checking to fix connection lockups
148+
149+
11/21/2024 - Change default debounce to 15ms
123150

124151
### adv360-z3.5
125152

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ endif
1212
.PHONY: all left clean_firmware clean_image clean
1313

1414
all:
15-
$(shell bin/get_version.sh >> /dev/null)
15+
$(shell bin/get_version_local.sh clique >> /dev/null)
1616
$(DOCKER) build --tag zmk --file Dockerfile .
1717
$(DOCKER) run --rm -it --name zmk \
1818
-v $(PWD)/firmware:/app/firmware$(SELINUX1) \
@@ -24,7 +24,7 @@ all:
2424
git checkout config/version.dtsi
2525

2626
left:
27-
$(shell bin/get_version.sh >> /dev/null)
27+
$(shell bin/get_version_local.sh clique >> /dev/null)
2828
$(DOCKER) build --tag zmk --file Dockerfile .
2929
$(DOCKER) run --rm -it --name zmk \
3030
-v $(PWD)/firmware:/app/firmware$(SELINUX1) \

bin/build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ TIMESTAMP="${TIMESTAMP:-$(date -u +"%Y%m%d%H%M")}"
77
COMMIT="${COMMIT:-$(echo xxxxxx)}"
88

99
# West Build (left)
10-
west build -s zmk/app -d build/left -b adv360_left -- -DZMK_CONFIG="${PWD}/config"
10+
west build -s zmk/app -p -d build/left -b adv360_left -S studio-rpc-usb-uart -- -DZMK_CONFIG="${PWD}/config" -DCONFIG_ZMK_STUDIO=y
1111
# Adv360 Left Kconfig file
1212
grep -vE '(^#|^$)' build/left/zephyr/.config
1313
# Rename zmk.uf2
14-
cp build/left/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-left.uf2"
14+
cp build/left/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-left-clique.uf2"
1515

1616
# Build right side if selected
1717
if [ "${BUILD_RIGHT}" = true ]; then
1818
# West Build (right)
19-
west build -s zmk/app -d build/right -b adv360_right -- -DZMK_CONFIG="${PWD}/config"
19+
west build -s zmk/app -p -d build/right -b adv360_right -S studio-rpc-usb-uart -- -DZMK_CONFIG="${PWD}/config" -DCONFIG_ZMK_STUDIO=y
2020
# Adv360 Right Kconfig file
2121
grep -vE '(^#|^$)' build/right/zephyr/.config
2222
# Rename zmk.uf2
23-
cp build/right/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-right.uf2"
23+
cp build/right/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-right-clique.uf2"
2424
fi

bin/get_version.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
date=$(date -u +"%Y%m%d")
55
branch=${1:-$(git rev-parse --abbrev-ref HEAD | cut -c1-4)}
66
commit=${2:-$(git rev-parse --short HEAD)}
7+
clique=${3:-"."}
78

89
uppercase_char() {
910
local char=$1
@@ -48,8 +49,16 @@ for ((i = 0; i < ${#commit}; i++)); do
4849
formatted_commit+=$(transform_char "${commit:$i:1}")
4950
done
5051

52+
formatted_commit+="<&kp MINUS>, "
53+
54+
# Iterate over the clique string and format characters
55+
formatted_clique=""
56+
for ((i = 0; i < ${#clique}; i++)); do
57+
formatted_clique+=$(transform_char "${clique:$i:1}")
58+
done
59+
5160
# Combine the formatted string, add trailing carriage return
52-
formatted_result="$formatted_date$formatted_branch$formatted_commit"
61+
formatted_result="$formatted_date$formatted_branch$formatted_commit$formatted_clique"
5362
formatted_result+="<&kp RET>"
5463

5564
echo $formatted_result
@@ -58,7 +67,6 @@ echo $formatted_result
5867
echo '#define VERSION_MACRO' > "config/version.dtsi"
5968
echo 'macro_ver: macro_ver {' >> "config/version.dtsi"
6069
echo 'compatible = "zmk,behavior-macro";' >> "config/version.dtsi"
61-
echo 'label = "macro_ver";' >> "config/version.dtsi"
6270
echo '#binding-cells = <0>;' >> "config/version.dtsi"
6371
echo "bindings = $formatted_result;" >> "config/version.dtsi"
6472
echo '};' >> "config/version.dtsi"

bin/get_version_local.sh

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/usr/bin/env bash
2+
3+
# Get the date, first 4 chars of branch name and short commit hash
4+
date=$(date -u +"%Y%m%d")
5+
branch=$(git rev-parse --abbrev-ref HEAD | cut -c1-4)
6+
commit=$(git rev-parse --short HEAD)
7+
clique=${1:-"."}
8+
9+
uppercase_char() {
10+
local char=$1
11+
12+
(echo $char | tr '[a-z]' '[A-Z]' 2> /dev/null) || echo "${char^^}"
13+
}
14+
15+
# Function to transform characters to ZMK key behaviours
16+
transform_char() {
17+
local char=$1
18+
19+
if [[ $char =~ [A-Za-z] ]]; then
20+
echo "<&kp $(uppercase_char $char)>, "
21+
elif [[ $char =~ [0-9] ]]; then
22+
echo "<&kp N${char}>, "
23+
elif [ "$char" = "." ]; then
24+
echo "<&kp DOT>, "
25+
fi
26+
}
27+
28+
# Iterate over the date and format characters
29+
formatted_date=""
30+
for ((i = 0; i < ${#date}; i++)); do
31+
formatted_date+=$(transform_char "${date:$i:1}")
32+
done
33+
34+
# Insert separator between date and branch
35+
formatted_date+="<&kp MINUS>, "
36+
37+
# Iterate over the branch and format characters
38+
formatted_branch=""
39+
for ((i = 0; i < ${#branch}; i++)); do
40+
formatted_branch+=$(transform_char "${branch:$i:1}")
41+
done
42+
43+
# Insert separator between branch and commit hash
44+
formatted_branch+="<&kp MINUS>, "
45+
46+
# Iterate over the commit hash and format characters
47+
formatted_commit=""
48+
for ((i = 0; i < ${#commit}; i++)); do
49+
formatted_commit+=$(transform_char "${commit:$i:1}")
50+
done
51+
52+
formatted_commit+="<&kp MINUS>, "
53+
54+
# Iterate over the clique string and format characters
55+
formatted_clique=""
56+
for ((i = 0; i < ${#clique}; i++)); do
57+
formatted_clique+=$(transform_char "${clique:$i:1}")
58+
done
59+
60+
# Combine the formatted string, add trailing carriage return
61+
formatted_result="$formatted_date$formatted_branch$formatted_commit$formatted_clique"
62+
formatted_result+="<&kp RET>"
63+
64+
echo $formatted_result
65+
# Create new macro to define version, overwrite previous one
66+
67+
echo '#define VERSION_MACRO' > "config/version.dtsi"
68+
echo 'macro_ver: macro_ver {' >> "config/version.dtsi"
69+
echo 'compatible = "zmk,behavior-macro";' >> "config/version.dtsi"
70+
echo 'display-name = "Version Macro";' >> "config/version.dtsi"
71+
echo '#binding-cells = <0>;' >> "config/version.dtsi"
72+
echo "bindings = $formatted_result;" >> "config/version.dtsi"
73+
echo '};' >> "config/version.dtsi"

config/adv360.keymap

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <dt-bindings/zmk/keys.h>
1717
#include <dt-bindings/zmk/outputs.h>
1818
#include <dt-bindings/zmk/rgb.h>
19+
#include <dt-bindings/zmk/stp.h>
20+
#include <dt-bindings/zmk/pointing.h>
1921

2022
&mt {
2123
quick-tap-ms = <175>;
@@ -24,7 +26,7 @@
2426

2527
/ {
2628
behaviors {
27-
#include "macros.dtsi"
29+
#include "macros.dtsi"
2830
#include "version.dtsi"
2931

3032
hm: homerow_mods {
@@ -42,6 +44,7 @@
4244
compatible = "zmk,keymap";
4345

4446
default_layer {
47+
display-name = "Base";
4548
bindings = <
4649
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &tog 2 &mo 4 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS
4750
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp DELETE &tog 1 &kp Y &kp U &kp I &kp O &kp P &kp BSLH
@@ -52,6 +55,7 @@
5255
};
5356

5457
gaming {
58+
display-name = "Gaming";
5559
bindings = <
5660
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
5761
&trans &trans &trans &trans &trans &kp T &trans &trans &trans &trans &trans &trans &trans &trans
@@ -62,6 +66,7 @@
6266
};
6367

6468
layer_keypad {
69+
display-name = "Keypad";
6570
bindings = <
6671
&trans &trans &trans &trans &trans &trans &trans &trans &trans &kp KP_NUM &kp EQUAL &kp FSLH &kp ASTERISK &trans
6772
&trans &trans &trans &trans &trans &trans &trans &trans &trans &kp N7 &kp N8 &kp N9 &kp MINUS &trans
@@ -72,6 +77,7 @@
7277
};
7378

7479
layer_fn {
80+
display-name = "Fn";
7581
bindings = <
7682
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &tog 2 &mo 4 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12
7783
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
@@ -82,16 +88,18 @@
8288
};
8389

8490
layer_mod {
91+
display-name = "Mod";
8592
bindings = <
8693
&none &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &none &trans &none &none &none &none &none &none
8794
&none &none &none &none &none &none &bootloader &bootloader &none &none &none &none &none &none
88-
&none &none &none &none &none &none &none &none &none &bt BT_CLR &out OUT_TOG &rgb_ug RGB_MEFS_CMD 5 &none &none &none &none &none &none
95+
&studio_unlock &none &none &none &none &none &none &none &none &bt BT_CLR &out OUT_TOG &stp STP_BAT &none &none &none &none &none &none
8996
&none &none &none &none &macro_ver &none &none &none &none &none &none &none &none &none
9097
&none &none &none &none &none &none &none &none &none &bl BL_TOG &rgb_ug RGB_TOG &bl BL_DEC &bl BL_INC &none &none &none
9198
>;
9299
};
93100

94101
media {
102+
display-name = "Media";
95103
bindings = <
96104
&none &none &none &kp PRINTSCREEN &none &none &none &none &none &none &none &none &none &none
97105
&none &none &none &none &none &none &none &trans &none &none &none &none &none &none
@@ -100,5 +108,24 @@
100108
&none &none &none &none &none &none &none &none &none &none &none &kp C_VOLUME_DOWN &kp C_VOLUME_UP &none &none &none
101109
>;
102110
};
111+
extra1 {
112+
display-name = "Red";
113+
status = "reserved";
114+
};
115+
116+
extra2 {
117+
display-name = "Purple";
118+
status = "reserved";
119+
};
120+
121+
extra3 {
122+
display-name = "Cyan";
123+
status = "reserved";
124+
};
125+
126+
extra4 {
127+
display-name = "Yellow";
128+
status = "reserved";
129+
};
103130
};
104131
};

0 commit comments

Comments
 (0)