Skip to content

Commit 429ed10

Browse files
ReFilMizkino
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 9c2eeb0 commit 429ed10

16 files changed

+714
-60
lines changed

.github/workflows/build.yml

+58-2
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

+28-1
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

+2-2
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

+4-4
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

+10-2
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

+73
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

+21
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
#include <dt-bindings/zmk/bt.h>
1818
#include <dt-bindings/zmk/outputs.h>
1919
#include <dt-bindings/zmk/rgb.h>
20+
#include <dt-bindings/zmk/stp.h>
2021
#include <dt-bindings/zmk/backlight.h>
22+
#include <dt-bindings/zmk/pointing.h>
2123

2224
/ {
2325
behaviors {
@@ -33,6 +35,25 @@
3335
flavor = "tap-preferred";
3436
bindings = <&kp>, <&kp>;
3537
};
38+
extra1 {
39+
display-name = "Red";
40+
status = "reserved";
41+
};
42+
43+
extra2 {
44+
display-name = "Purple";
45+
status = "reserved";
46+
};
47+
48+
extra3 {
49+
display-name = "Cyan";
50+
status = "reserved";
51+
};
52+
53+
extra4 {
54+
display-name = "Yellow";
55+
status = "reserved";
56+
};
3657
};
3758

3859
keymap {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#include <physical_layouts.dtsi>
2+
3+
/ {
4+
physical_layout0: physical_layout_0 {
5+
compatible = "zmk,physical-layout";
6+
display-name = "Default";
7+
8+
keys // w h x y rot rx ry
9+
= <&key_physical_attrs 125 100 0 25 0 0 0>
10+
, <&key_physical_attrs 100 100 125 25 0 0 0>
11+
, <&key_physical_attrs 100 100 225 0 0 0 0>
12+
, <&key_physical_attrs 100 100 325 0 0 0 0>
13+
, <&key_physical_attrs 100 100 425 0 0 0 0>
14+
, <&key_physical_attrs 100 100 525 0 0 0 0>
15+
, <&key_physical_attrs 100 100 625 0 0 0 0>
16+
, <&key_physical_attrs 100 100 1075 0 0 0 0>
17+
, <&key_physical_attrs 100 100 1175 0 0 0 0>
18+
, <&key_physical_attrs 100 100 1275 0 0 0 0>
19+
, <&key_physical_attrs 100 100 1375 0 0 0 0>
20+
, <&key_physical_attrs 100 100 1475 0 0 0 0>
21+
, <&key_physical_attrs 100 100 1575 25 0 0 0>
22+
, <&key_physical_attrs 125 100 1675 25 0 0 0>
23+
, <&key_physical_attrs 125 100 0 125 0 0 0>
24+
, <&key_physical_attrs 100 100 125 125 0 0 0>
25+
, <&key_physical_attrs 100 100 225 100 0 0 0>
26+
, <&key_physical_attrs 100 100 325 100 0 0 0>
27+
, <&key_physical_attrs 100 100 425 100 0 0 0>
28+
, <&key_physical_attrs 100 100 525 100 0 0 0>
29+
, <&key_physical_attrs 100 100 625 100 0 0 0>
30+
, <&key_physical_attrs 100 100 1075 100 0 0 0>
31+
, <&key_physical_attrs 100 100 1175 100 0 0 0>
32+
, <&key_physical_attrs 100 100 1275 100 0 0 0>
33+
, <&key_physical_attrs 100 100 1375 100 0 0 0>
34+
, <&key_physical_attrs 100 100 1475 100 0 0 0>
35+
, <&key_physical_attrs 100 100 1575 125 0 0 0>
36+
, <&key_physical_attrs 125 100 1675 125 0 0 0>
37+
, <&key_physical_attrs 125 100 0 225 0 0 0>
38+
, <&key_physical_attrs 100 100 125 225 0 0 0>
39+
, <&key_physical_attrs 100 100 225 200 0 0 0>
40+
, <&key_physical_attrs 100 100 325 200 0 0 0>
41+
, <&key_physical_attrs 100 100 425 200 0 0 0>
42+
, <&key_physical_attrs 100 100 525 200 0 0 0>
43+
, <&key_physical_attrs 100 100 625 200 0 0 0>
44+
, <&key_physical_attrs 100 100 675 400 1500 525 400>
45+
, <&key_physical_attrs 100 100 775 400 1500 525 400>
46+
, <&key_physical_attrs 100 100 925 400 (-1500) 1275 400>
47+
, <&key_physical_attrs 100 100 1025 400 (-1500) 1275 400>
48+
, <&key_physical_attrs 100 100 1075 200 0 0 0>
49+
, <&key_physical_attrs 100 100 1175 200 0 0 0>
50+
, <&key_physical_attrs 100 100 1275 200 0 0 0>
51+
, <&key_physical_attrs 100 100 1375 200 0 0 0>
52+
, <&key_physical_attrs 100 100 1475 200 0 0 0>
53+
, <&key_physical_attrs 100 100 1575 225 0 0 0>
54+
, <&key_physical_attrs 125 100 1675 225 0 0 0>
55+
, <&key_physical_attrs 125 100 0 325 0 0 0>
56+
, <&key_physical_attrs 100 100 125 325 0 0 0>
57+
, <&key_physical_attrs 100 100 225 300 0 0 0>
58+
, <&key_physical_attrs 100 100 325 300 0 0 0>
59+
, <&key_physical_attrs 100 100 425 300 0 0 0>
60+
, <&key_physical_attrs 100 100 525 300 0 0 0>
61+
, <&key_physical_attrs 100 100 775 500 1500 525 400>
62+
, <&key_physical_attrs 100 100 925 500 (-1500) 1275 400>
63+
, <&key_physical_attrs 100 100 1175 300 0 0 0>
64+
, <&key_physical_attrs 100 100 1275 300 0 0 0>
65+
, <&key_physical_attrs 100 100 1375 300 0 0 0>
66+
, <&key_physical_attrs 100 100 1475 300 0 0 0>
67+
, <&key_physical_attrs 100 100 1575 325 0 0 0>
68+
, <&key_physical_attrs 125 100 1675 325 0 0 0>
69+
, <&key_physical_attrs 125 100 0 425 0 0 0>
70+
, <&key_physical_attrs 100 100 125 425 0 0 0>
71+
, <&key_physical_attrs 100 100 225 400 0 0 0>
72+
, <&key_physical_attrs 100 100 325 400 0 0 0>
73+
, <&key_physical_attrs 100 100 425 400 0 0 0>
74+
, <&key_physical_attrs 100 200 575 500 1500 525 400>
75+
, <&key_physical_attrs 100 200 675 500 1500 525 400>
76+
, <&key_physical_attrs 100 100 775 600 1500 525 400>
77+
, <&key_physical_attrs 100 100 925 600 (-1500) 1275 400>
78+
, <&key_physical_attrs 100 200 1025 500 (-1500) 1275 400>
79+
, <&key_physical_attrs 100 200 1125 500 (-1500) 1275 400>
80+
, <&key_physical_attrs 100 100 1275 400 0 0 0>
81+
, <&key_physical_attrs 100 100 1375 400 0 0 0>
82+
, <&key_physical_attrs 100 100 1475 400 0 0 0>
83+
, <&key_physical_attrs 100 100 1575 425 0 0 0>
84+
, <&key_physical_attrs 125 100 1675 425 0 0 0>
85+
;
86+
};
87+
};

0 commit comments

Comments
 (0)