Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clique and mouse movement update #630

Merged
merged 14 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
29 changes: 28 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Here's all notable changes and commits to both the configuration repo and the ba
Many thanks to all those who have submitted issues and pull requests to make this firmware better!
## Config repo

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)

11/27/2024 - Fix misattributed PR link in changelog [#590](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/590)

4/16/2024 - Fix changelog dates [#448](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/448)
Expand Down Expand Up @@ -119,7 +121,32 @@ There have beeen 5 branches of ZMK used for the 360 Pro so far. Beta branches ar
| [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) |
| [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) |
| [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) |
| [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) |
| [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) |
| [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) |

### adv360-z3.5-2

1/26/2025 - Change mouse key press metadata to suit clique

1/25/2025 - Add new battery indication behavior

1/22/2025 - Send RGB effect over to the peripheral

1/14/2025 - Prevent ext power from saving to flash

1/14/2025 - Transmit RGB "on" state over the bluetooth connection

1/13/2025 - Add metadata to mouse button behaivior

1/11/2025 - Prevent RGB handler saving to flash

1/11/2025 - Changes to fix building after rebase

1/4/2025 - Rebase to latest ZMK (commit 3377ed02)

11/21/2024 - Add additional checking to fix connection lockups

11/21/2024 - Change default debounce to 15ms

### adv360-z3.5

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif
.PHONY: all left clean_firmware clean_image clean

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

left:
$(shell bin/get_version.sh >> /dev/null)
$(shell bin/get_version_local.sh clique >> /dev/null)
$(DOCKER) build --tag zmk --file Dockerfile .
$(DOCKER) run --rm -it --name zmk \
-v $(PWD)/firmware:/app/firmware$(SELINUX1) \
Expand Down
8 changes: 4 additions & 4 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ TIMESTAMP="${TIMESTAMP:-$(date -u +"%Y%m%d%H%M")}"
COMMIT="${COMMIT:-$(echo xxxxxx)}"

# West Build (left)
west build -s zmk/app -d build/left -b adv360_left -- -DZMK_CONFIG="${PWD}/config"
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
# Adv360 Left Kconfig file
grep -vE '(^#|^$)' build/left/zephyr/.config
# Rename zmk.uf2
cp build/left/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-left.uf2"
cp build/left/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-left-clique.uf2"

# Build right side if selected
if [ "${BUILD_RIGHT}" = true ]; then
# West Build (right)
west build -s zmk/app -d build/right -b adv360_right -- -DZMK_CONFIG="${PWD}/config"
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
# Adv360 Right Kconfig file
grep -vE '(^#|^$)' build/right/zephyr/.config
# Rename zmk.uf2
cp build/right/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-right.uf2"
cp build/right/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-right-clique.uf2"
fi
12 changes: 10 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 "${clique:$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,6 @@ 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 '#binding-cells = <0>;' >> "config/version.dtsi"
echo "bindings = $formatted_result;" >> "config/version.dtsi"
echo '};' >> "config/version.dtsi"
73 changes: 73 additions & 0 deletions bin/get_version_local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/usr/bin/env bash

# Get the date, first 4 chars of branch name and short commit hash
date=$(date -u +"%Y%m%d")
branch=$(git rev-parse --abbrev-ref HEAD | cut -c1-4)
commit=$(git rev-parse --short HEAD)
clique=${1:-"."}

uppercase_char() {
local char=$1

(echo $char | tr '[a-z]' '[A-Z]' 2> /dev/null) || echo "${char^^}"
}

# Function to transform characters to ZMK key behaviours
transform_char() {
local char=$1

if [[ $char =~ [A-Za-z] ]]; then
echo "<&kp $(uppercase_char $char)>, "
elif [[ $char =~ [0-9] ]]; then
echo "<&kp N${char}>, "
elif [ "$char" = "." ]; then
echo "<&kp DOT>, "
fi
}

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

# Insert separator between date and branch
formatted_date+="<&kp MINUS>, "

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

# Insert separator between branch and commit hash
formatted_branch+="<&kp MINUS>, "

# Iterate over the commit hash and format characters
formatted_commit=""
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 "${clique:$i:1}")
done

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

echo $formatted_result
# Create new macro to define version, overwrite previous one

echo '#define VERSION_MACRO' > "config/version.dtsi"
echo 'macro_ver: macro_ver {' >> "config/version.dtsi"
echo 'compatible = "zmk,behavior-macro";' >> "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"
27 changes: 26 additions & 1 deletion config/adv360.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/rgb.h>
#include <dt-bindings/zmk/stp.h>
#include <dt-bindings/zmk/backlight.h>
#include <dt-bindings/zmk/pointing.h>

/ {
behaviors {
Expand Down Expand Up @@ -32,6 +34,7 @@
compatible = "zmk,keymap";

default_layer {
display-name = "Base";
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
Expand All @@ -41,6 +44,7 @@
>;
};
keypad {
display-name = "Kp";
bindings = <
&kp EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &trans &mo 3 &kp N6 &kp KP_NUM &kp KP_EQUAL &kp KP_DIVIDE &kp KP_MULTIPLY &kp MINUS
&kp TAB &kp Q &kp W &kp E &kp R &kp T &none &none &kp Y &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MINUS &kp BSLH
Expand All @@ -50,6 +54,7 @@
>;
};
fn {
display-name = "Fn";
bindings = <
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &tog 1 &mo 3 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12
&trans &trans &trans &trans &trans &trans &none &none &trans &trans &trans &trans &trans &trans
Expand All @@ -59,13 +64,33 @@
>;
};
mod {
display-name = "Mod";
bindings = <
&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
&none &none &none &none &none &none &bootloader &bootloader &none &none &none &none &none &none
&none &none &none &none &none &none &none &none &none &bt BT_CLR &none &rgb_ug RGB_MEFS_CMD 5 &none &none &none &none &none &none
&studio_unlock &none &none &none &none &none &none &none &none &bt BT_CLR &none &stp STP_BAT &none &none &none &none &none &none
&none &none &none &none &macro_ver &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none &none &none &none &bl BL_TOG &rgb_ug RGB_TOG &bl BL_INC &bl BL_DEC &none &none &none
>;
};
extra1 {
display-name = "Red";
status = "reserved";
};

extra2 {
display-name = "Purple";
status = "reserved";
};

extra3 {
display-name = "Cyan";
status = "reserved";
};

extra4 {
display-name = "Yellow";
status = "reserved";
};
};
};
Loading