Skip to content

Commit

Permalink
Add dongle support with updated 3610 driver, peripheral input relay, …
Browse files Browse the repository at this point in the history
…and input behavior listener. (#9)

* initial attempt to use third nano as dongle

* update pmw3610 driver remote

* update conf files

* change driver and configure third mcu as dongle

* update path for build yaml to find keymap files

* update configs to reduce Kconfig warnings

* update configs to include new driver options

* add firmware reset build

* update central role split config

* add trackball_listener to the 3610.dtsi config

* add BLE to dongle

* update trackball listener

* add macros back in and update CPI resolution

* adjust and test CPI sensitivity

* Add dongle support with updated 3610 driver, peripherial input relay, and input behavior listener.

* add bt and dongle build steps to the same build yaml

* test dongle and firmware reset builds

* add cron job to run every two months to keep artifacts from expiring

* update readme

* remove non-targeted shields to prevent incorrect files used to build

* updaqte bt conf to set right side as central

* update pmw3610 conf and power management settings
  • Loading branch information
280Zo authored Oct 28, 2024
1 parent ed66f92 commit fbb4d95
Show file tree
Hide file tree
Showing 38 changed files with 1,630 additions and 609 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: ZMK Firmware

on: [push, workflow_dispatch]
on:
push:
workflow_dispatch:
schedule:
- cron: '0 0 1 */2 *' # run every two months to keep artifacts from expiring

jobs:
convert-and-store-keymap:
Expand Down
47 changes: 24 additions & 23 deletions .github/workflows/draw_keymaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,29 +140,30 @@ jobs:
id: draw
env:
KEYMAP_raw_binding_map: >
{"&bootloader": "BOOT LDR"
, "&mkp RCLK": "R CLK"
, "&mkp LCLK": "L CLK"
, "&mkp MCLK": "M CLK"
, "&mkp MB5": "FWD"
, "&mmv MOVE_RIGHT": "MOVE R"
, "&mmv MOVE_DOWN": "MOVE D"
, "&mmv MOVE_LEFT": "MOVE L"
, "&mkp MB4": "BACK"
, "&msc MOVE_RIGHT": "WHEEL R"
, "&msc MOVE_DOWN": "WHEEL U"
, "&mmv MOVE_UP": "MOVE UP"
, "&msc MOVE_UP": "WHEEL D"
, "&msc MOVE_LEFT": "WHEEL L"
, "&HSplit": "HSPLIT"
, "&VSplit": "VSPLIT"
, "&caps_word": "CAPS WORD"
, "&td_bore": "L_BASE L_EXTRA"
, "&tdtb": "SCROLL TRACKBALL"
, "&tdtb2": "SCROLL SNIPE"
, "&tdmt": "L1/BS LCLICK"
, "&tdbt": "L2/ESC RCLICK"
}
{
"&bootloader": "BOOT LDR",
"&mkp RCLK": "R CLK",
"&mkp LCLK": "L CLK",
"&mkp MCLK": "M CLK",
"&mkp MB4": "BACK",
"&mkp MB5": "FWD",
"&mmv MOVE_UP": "MOVE UP",
"&mmv MOVE_DOWN": "MOVE D",
"&mmv MOVE_LEFT": "MOVE L",
"&mmv MOVE_RIGHT": "MOVE R",
"&msc MOVE_UP": "WHEEL D",
"&msc MOVE_DOWN": "WHEEL U",
"&msc MOVE_LEFT": "WHEEL L",
"&msc MOVE_RIGHT": "WHEEL R",
"&HSplit": "HSPLIT",
"&VSplit": "VSPLIT",
"&caps_word": "CAPS WORD",
"&td_bore": "L_BASE L_EXTRA",
"&tdtb": "SCROLL TRACKBALL",
"&tdtb2": "SCROLL SNIPE",
"&tdmt": "L1/BS LCLICK",
"&tdbt": "L2/ESC RCLICK"
}
run: |
get_args() {
local keyboard=$2
Expand Down
116 changes: 93 additions & 23 deletions .github/workflows/user_config_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ on:
default: "config"
required: false
type: string
shield_path:
description: "Path to the shields directory"
default: "boards/shields/charybdis"
required: false
type: string
keymap_path:
description: "Path to the keymap directory"
default: "config/boards/shields/charybdis-mini-wireless/keymaps"
default: "boards/shields/charybdis/keymaps"
required: false
type: string
fallback_binary:
Expand Down Expand Up @@ -65,6 +70,7 @@ jobs:
board: ${{ matrix.board }}
shield: ${{ matrix.shield }}
keymap: ${{ matrix.keymap }}
format: ${{ matrix.format }}
artifact_name: ${{ matrix.artifact-name }}
snippet: ${{ matrix.snippet }}
run: |
Expand All @@ -85,36 +91,66 @@ jobs:
echo "extra_west_args=${extra_west_args}" >> $GITHUB_ENV
echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}${zmk_load_arg}" >> $GITHUB_ENV
echo "display_name=${shield:+$shield - }${board}" >> $GITHUB_ENV
echo "format=${format}" >> $GITHUB_ENV
echo "keymap=${keymap}" >> $GITHUB_ENV
echo "shield=${shield}" >> $GITHUB_ENV
echo "artifact_name=${artifact_name:-${shield:+$shield-}${board}-zmk}" >> $GITHUB_ENV
- name: Download artifacts
- name: Download keymaps
uses: actions/download-artifact@v4
with:
name: keymap_files
path: "${{ github.workspace }}/"

- name: Move keymaps to keymap directory
- name: Copy keymaps to keymap directory
run: |
rm -f $GITHUB_WORKSPACE/config/*.keymap
mkdir -p "$GITHUB_WORKSPACE/config/boards/shields/charybdis-mini-wireless/keymaps/"
mkdir -p "$GITHUB_WORKSPACE/${{ inputs.keymap_path }}/"
cd "$GITHUB_WORKSPACE"
mv charybdis.keymap charybdis_qwerty.keymap
mv *.keymap "$GITHUB_WORKSPACE/config/boards/shields/charybdis-mini-wireless/keymaps/"
ls -lR "$GITHUB_WORKSPACE/config/boards/shields/charybdis-mini-wireless/keymaps/"
mv charybdis.keymap qwerty.keymap
mv *.keymap "$GITHUB_WORKSPACE/${{ inputs.keymap_path }}/"
ls -lR "$GITHUB_WORKSPACE/${{ inputs.keymap_path }}/"
- name: Copy config files to isolated temporary directory
run: |
if [ "${{ env.base_dir }}" != "${GITHUB_WORKSPACE}" ]; then
apt-get -qq update && apt-get -q install -o Dpkg::Progress-Fancy="0" -o APT::Color="0" -o Dpkg::Use-Pty="0" tree
# Define base directory for config
base_config_path="${{ env.base_dir }}/${{ inputs.config_path }}"
mkdir "$base_config_path"
# Create config directory
mkdir -p "$base_config_path"
# Copy config files
cp -R "${{ inputs.config_path }}"/* "$base_config_path/"
echo "base installed"
# Copy active keymap to the board directory
cp -Rv "$base_config_path/boards/shields/charybdis-mini-wireless/keymaps/${{ matrix.keymap }}.keymap" \
"$base_config_path/boards/shields/charybdis-mini-wireless/charybdis.keymap"
echo "config files ready"
# Copy active keymap to the board directory & adjust for bt/dongle format
if [ "${{ env.shield }}" != "settings_reset" ]; then
cp -Rv "$GITHUB_WORKSPACE/${{ inputs.keymap_path }}/${{ env.keymap }}.keymap" \
"$base_config_path/charybdis.keymap"
echo "format: ${{ env.format }}"
case "${{ env.format }}" in
*bt*)
echo "converting trackball device to bt/usb format"
sed -i 's/device = <&vtrackball>;/device = <\&trackball>;/g' "$base_config_path/charybdis.keymap"
grep "device = <" "$base_config_path/charybdis.keymap"
;;
esac fi
fi
# Remove untargeted shields so they don't get auto picked up by the west build command
find "${GITHUB_WORKSPACE}/boards/shields" \
-mindepth 1 \
-maxdepth 1 \
! -name "charybdis-${{ env.format }}" \
-exec rm -rf {} +
echo "Removed extra shields"
echo "Build files list:"
ls -R "${{ env.base_dir }}"
tree "${{ env.base_dir }}"
tree "${GITHUB_WORKSPACE}/boards/shields"
- name: Cache west modules
uses: actions/cache@v4
Expand Down Expand Up @@ -149,7 +185,7 @@ jobs:
- name: West Build (${{ env.display_name }})
working-directory: ${{ env.base_dir }}
shell: sh -x {0}
run: west build -s zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" ${{ env.extra_west_args }} -- -DZMK_CONFIG=${{ env.base_dir }}/${{ inputs.config_path }} ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}
run: west build --pristine -s zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" ${{ env.extra_west_args }} -- -DZMK_CONFIG=${{ env.base_dir }}/${{ inputs.config_path }} ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}

- name: ${{ env.display_name }} Kconfig file
run: |
Expand Down Expand Up @@ -186,26 +222,60 @@ jobs:
cp "${{ env.build_dir }}/zephyr/zmk.${{ inputs.fallback_binary }}" "${{ env.build_dir }}/artifacts/${{ env.artifact_name }}.${{ inputs.fallback_binary }}"
fi
- name: Archive (${{ env.display_name }})
- name: Upload (${{ env.display_name }})
uses: actions/upload-artifact@v4
with:
name: artifact-${{ env.artifact_name }}
path: ${{ env.build_dir }}/artifacts

merge:
cleanup:
runs-on: ubuntu-latest
continue-on-error: true
needs: build
name: Merge Output Artifacts
name: Merge & Prune Artifacts (optional)
steps:
- name: Merge QWERTY Artifacts
- name: Upload Charybdis ZMK Firmware (QWERTY BT)
continue-on-error: true
uses: actions/upload-artifact/merge@v4
with:
pattern: artifact-charybdis_qwerty_{left,right}
name: firmware-charybdis-qwerty
delete-merged: true

- name: Upload Charybdis ZMK Firmware (QWERTY Dongle)
continue-on-error: true
uses: actions/upload-artifact/merge@v4
with:
name: "firmware-charybdis-nanov2-qwerty"
pattern: artifact-charybdis_qwerty*
pattern: artifact-charybdis_qwerty_dongle*
name: firmware-charybdis-qwerty-dongle
delete-merged: true
- name: Merge Colemak DH Artifacts

- name: Upload Charybdis ZMK Firmware (Colemak BT)
continue-on-error: true
uses: actions/upload-artifact/merge@v4
with:
name: "firmware-charybdis-nanov2-colemakdh"
pattern: artifact-charybdis_colemak*
pattern: artifact-charybdis_colemak_{left,right}
name: firmware-charybdis-colemak
delete-merged: true

- name: Upload Charybdis ZMK Firmware (Colemak Dongle)
continue-on-error: true
uses: actions/upload-artifact/merge@v4
with:
pattern: artifact-charybdis_colemak_dongle*
name: firmware-charybdis-colemak-dongle
delete-merged: true

- name: Upload Firmware Reset (Nano v2)
continue-on-error: true
uses: actions/upload-artifact/merge@v4
with:
pattern: artifact-firmware_reset_nano_v2
name: firmware-reset-nanov2
delete-merged: true

- name: Delete keymap artifacts
continue-on-error: true
uses: geekyeggo/delete-artifact@v5
with:
name: keymap_files
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
boards/shields/charybdis/charybdis.keymap
drivers/
Loading

0 comments on commit fbb4d95

Please sign in to comment.