Skip to content
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
76 changes: 74 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,77 @@
on: [push, pull_request, workflow_dispatch]
on:
push:
branches:
- main-zmk_0.3
tags:
- "*-zmk_*"
pull_request:
workflow_dispatch:

jobs:
build:
uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main
uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@v0.3.0

release:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-zmk_')
permissions:
contents: write
steps:
- name: Extract version info
id: version
run: |
# Extract tag name (e.g., "1.0.0-zmk_0.2.1")
TAG=${GITHUB_REF#refs/tags/}
echo "tag=$TAG" >> $GITHUB_OUTPUT

# Extract ZMK version (everything after "-zmk_")
ZMK_VERSION=${TAG##*-zmk_}
echo "zmk_version=$ZMK_VERSION" >> $GITHUB_OUTPUT

# Extract release version (everything before "-zmk_")
RELEASE_VERSION=${TAG%%-zmk_*}
echo "release_version=$RELEASE_VERSION" >> $GITHUB_OUTPUT

- name: Download firmware artifacts
uses: actions/download-artifact@v4
with:
name: firmware
path: firmware

- name: Rename firmware files with ZMK version
run: |
mkdir firmware-release
cd firmware
for file in *; do
# Get file extension
ext="${file##*.}"
# Get filename without extension
name="${file%.*}"
# Rename with ZMK version postfix
cp "$file" "../firmware-release/${name}-zmk_${{ steps.version.outputs.zmk_version }}.${ext}"
done
cd ..
ls -lah firmware-release/

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: firmware-release/*
name: Release ${{ steps.version.outputs.tag }}
body: |
## CCK-BALL Firmware Release ${{ steps.version.outputs.release_version }}

**ZMK Version:** ${{ steps.version.outputs.zmk_version }}

### Installation
1. Download the appropriate `.uf2` file for your keyboard
2. Put your keyboard into bootloader mode
3. Copy the `.uf2` file to the mounted drive
4. The keyboard will automatically reboot with the new firmware

---
generate_release_notes: true
append_body: true
draft: false
prerelease: false
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Build artifacts
build/
*.uf2

# ZMK workspace (only needed for native builds, not Docker)
modules/
tools/
zephyr/
bootloader/
zmk/
.west/
130 changes: 130 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# CCK-BALL ZMK Firmware Build Makefile

# Configuration
BOARD := nice_nano
ZMK_CONFIG := /work/config
BUILD_DIR := build
OUTPUT_DIR := /work

# Snippet for ZMK Studio support (right side only)
STUDIO_SNIPPET := studio-rpc-usb-uart

# Docker configuration
DOCKER_IMAGE := zmkfirmware/zmk-build-arm:stable
DOCKER_CMD := docker run --rm -w /work -v $(CURDIR):/work $(DOCKER_IMAGE)

.PHONY: all setup init update left right clean help settings-reset
.PHONY: docker-all docker-setup docker-left docker-right docker-clean docker-settings-reset

# Default target: build both halves
all: left right

# Full setup (init + update + export)
setup: init update export

# Initialize west workspace
init:
west init -l config

# Update west modules
update:
west update

# Export Zephyr
export:
west zephyr-export

# Install development dependencies (requires root)
deps:
apt update && apt install -y vim

# Build left half (peripheral)
left:
west zephyr-export
west build -p always -s zmk/app -b $(BOARD) -- \
-DZMK_CONFIG=$(ZMK_CONFIG) \
-DSHIELD=cck_ball_left
cp $(BUILD_DIR)/zephyr/zmk.uf2 $(OUTPUT_DIR)/zmk_cck_ball_left.uf2
@echo "✓ Left half built: $(OUTPUT_DIR)/zmk_cck_ball_left.uf2"

# Build right half (central - with ZMK Studio support)
right:
west zephyr-export
west build -p always -s zmk/app -b $(BOARD) -S $(STUDIO_SNIPPET) -- \
-DZMK_CONFIG=$(ZMK_CONFIG) \
-DSHIELD=cck_ball_right \
-DCONFIG_ZMK_STUDIO=y
cp $(BUILD_DIR)/zephyr/zmk.uf2 $(OUTPUT_DIR)/zmk_cck_ball_right.uf2
@echo "✓ Right half built: $(OUTPUT_DIR)/zmk_cck_ball_right.uf2"

# Clean build directory
clean:
rm -rf $(BUILD_DIR)
@echo "✓ Build directory cleaned"

# Build settings reset firmware (both halves)
settings-reset:
west zephyr-export
west build -p always -s zmk/app -b $(BOARD) -- \
-DZMK_CONFIG=$(ZMK_CONFIG) \
-DSHIELD="settings_reset"
cp $(BUILD_DIR)/zephyr/zmk.uf2 $(OUTPUT_DIR)/settings_reset.uf2
@echo "✓ Settings reset built: $(OUTPUT_DIR)/settings_reset.uf2"

# ============================================
# Docker Build Targets
# ============================================

# Docker: Build both halves
docker-all:
$(DOCKER_CMD) make all

# Docker: Setup workspace
docker-setup:
$(DOCKER_CMD) make setup

# Docker: Build left half
docker-left:
$(DOCKER_CMD) make left

# Docker: Build right half
docker-right:
$(DOCKER_CMD) make right

# Docker: Clean build
docker-clean:
$(DOCKER_CMD) make clean

# Docker: Build settings reset
docker-settings-reset:
$(DOCKER_CMD) make settings-reset

# Help
help:
@echo "CCK-BALL ZMK Firmware Build"
@echo ""
@echo "=== Docker Builds (Recommended) ==="
@echo "Usage: make docker-[target]"
@echo ""
@echo " docker-all - Build both halves using Docker"
@echo " docker-setup - Initialize workspace using Docker"
@echo " docker-left - Build left half using Docker"
@echo " docker-right - Build right half using Docker (with ZMK Studio)"
@echo " docker-settings-reset - Build settings reset using Docker"
@echo " docker-clean - Clean build directory using Docker"
@echo ""
@echo "=== Native Builds (requires west installed) ==="
@echo "Usage: make [target]"
@echo ""
@echo " all - Build both left and right halves (default)"
@echo " setup - Initialize workspace (init + update + export)"
@echo " init - Initialize west workspace"
@echo " update - Update west modules"
@echo " export - Export Zephyr"
@echo " deps - Install development dependencies"
@echo " left - Build left half only"
@echo " right - Build right half only (with ZMK Studio)"
@echo " settings-reset - Build settings reset firmware"
@echo " clean - Clean build directory"
@echo " help - Show this help message"

10 changes: 5 additions & 5 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
# control, add individual board + shield combinations to
# the `include` property, e.g:
#
# board: [ "nice_nano_v2" ]
# board: [ "nice_nano" ]
# shield: [ "corne_left", "corne_right" ]
# include:
# - board: bdn9_rev2
# - board: nice_nano_v2
# - board: nice_nano
# shield: reviung41
#
---
include:
- board: nice_nano_v2
- board: nice_nano
shield: cck_ball_left
- board: nice_nano_v2
- board: nice_nano
shield: cck_ball_right
snippet: studio-rpc-usb-uart
cmake-args: -DCONFIG_ZMK_STUDIO=y
- board: nice_nano_v2
- board: nice_nano
shield: settings_reset
30 changes: 9 additions & 21 deletions config/boards/shields/cck_ball/cck_ball-layouts.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/ {
cck_ball_layouts: cck_ball_layouts {
compatible = "zmk,physical-layout";
display-name = "CCK BALL Wireless";
display-name = "Default";
transform = <&default_transform>;
keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 38 0 0 0>
Expand Down Expand Up @@ -44,28 +44,16 @@
, <&key_physical_attrs 100 100 1700 238 0 0 0>
, <&key_physical_attrs 100 100 0 338 0 0 0>
, <&key_physical_attrs 100 100 100 338 0 0 0>
, <&key_physical_attrs 100 100 200 313 0 0 0>
, <&key_physical_attrs 100 100 300 300 0 0 0>
, <&key_physical_attrs 100 100 400 313 0 0 0>
, <&key_physical_attrs 100 100 500 325 0 0 0>
, <&key_physical_attrs 100 100 1200 325 0 0 0>
, <&key_physical_attrs 100 100 1300 313 0 0 0>
, <&key_physical_attrs 100 100 1400 300 0 0 0>
, <&key_physical_attrs 100 100 1500 313 0 0 0>
, <&key_physical_attrs 100 100 200 338 0 0 0>
, <&key_physical_attrs 100 100 500 338 0 0 0>
, <&key_physical_attrs 100 100 600 363 0 0 0>
, <&key_physical_attrs 100 100 700 388 0 0 0>
, <&key_physical_attrs 100 100 1000 388 0 0 0>
, <&key_physical_attrs 100 100 1100 363 0 0 0>
, <&key_physical_attrs 100 100 1200 338 0 0 0>
, <&key_physical_attrs 100 100 1500 338 0 0 0>
, <&key_physical_attrs 100 100 1600 338 0 0 0>
, <&key_physical_attrs 100 100 1700 338 0 0 0>
, <&key_physical_attrs 100 100 0 438 0 0 0>
, <&key_physical_attrs 100 100 100 438 0 0 0>
, <&key_physical_attrs 100 100 200 438 0 0 0>
, <&key_physical_attrs 100 100 500 438 0 0 0>
, <&key_physical_attrs 100 100 600 463 0 0 0>
, <&key_physical_attrs 100 100 700 488 0 0 0>
, <&key_physical_attrs 100 100 1000 488 0 0 0>
, <&key_physical_attrs 100 100 1100 463 0 0 0>
, <&key_physical_attrs 100 100 1200 438 0 0 0>
, <&key_physical_attrs 100 100 1500 438 0 0 0>
, <&key_physical_attrs 100 100 1600 438 0 0 0>
, <&key_physical_attrs 100 100 1700 438 0 0 0>
;
};
};
14 changes: 6 additions & 8 deletions config/boards/shields/cck_ball/cck_ball.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <12>;
rows = <5>;
rows = <4>;

map = <
RC(0,5) RC(0,4) RC(0,3) RC(0,2) RC(0,1) RC(0,0) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11)
RC(1,5) RC(1,4) RC(1,3) RC(1,2) RC(1,1) RC(1,0) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11)
RC(2,5) RC(2,4) RC(2,3) RC(2,2) RC(2,1) RC(2,0) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11)
RC(3,5) RC(3,4) RC(3,3) RC(3,2) RC(3,1) RC(3,0) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11)
RC(4,5) RC(4,4) RC(4,3) RC(4,2) RC(4,1) RC(4,0) RC(4,6) RC(4,7) RC(4,8) RC(4,9) RC(4,10) RC(4,11)
RC(3,5) RC(3,4) RC(3,3) RC(3,2) RC(3,1) RC(3,0) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11)
>;
};

Expand All @@ -30,8 +29,7 @@

diode-direction = "col2row";
row-gpios
= <&gpio0 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
= <&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 24 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 22 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
Expand All @@ -45,7 +43,7 @@
label = "LEFT_ENCODER";
a-gpios = <&gpio0 29 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio0 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
steps = <12>;
steps = <72>;
};

right_encoder: encoder_right {
Expand All @@ -54,13 +52,13 @@
label = "RIGHT_ENCODER";
a-gpios = <&gpio0 29 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio0 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
steps = <12>;
steps = <72>;
};

sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <10>;
triggers-per-rotation = <24>;
};

};
Expand Down
33 changes: 18 additions & 15 deletions config/boards/shields/cck_ball/cck_ball_right.conf
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
CONFIG_SPI=y

CONFIG_SPI=y
CONFIG_INPUT=y
CONFIG_ZMK_MOUSE=y
# CONFIG_ZMK_POINTING=y
# CONFIG_ZMK_MOUSE=y
CONFIG_ZMK_POINTING=y
#CONFIG_ZMK_POINTING_DEVICE=y

CONFIG_ZMK_EXT_POWER=y

CONFIG_PMW3610=y
CONFIG_PMW3610_CPI=1200
CONFIG_PMW3610_CPI_DIVIDOR=4
CONFIG_PMW3610_ORIENTATION_270=y
CONFIG_PMW3610_SNIPE_CPI=200
CONFIG_PMW3610_SNIPE_CPI_DIVIDOR=1
CONFIG_PMW3610_SCROLL_TICK=70
CONFIG_PMW3610_INVERT_X=y

CONFIG_PMW3610_POLLING_RATE_125_SW=y
CONFIG_PMW3610_SMART_ALGORITHM=y
#CONFIG_PMW3610=y
#CONFIG_PMW3610_CPI=1200
#CONFIG_PMW3610_CPI_DIVIDOR=4
#CONFIG_PMW3610_ORIENTATION_270=y
#CONFIG_PMW3610_SNIPE_CPI=200
#CONFIG_PMW3610_SNIPE_CPI_DIVIDOR=1
#CONFIG_PMW3610_SCROLL_TICK=70
#CONFIG_PMW3610_INVERT_X=y

#CONFIG_PMW3610_POLLING_RATE_125_SW=y
#CONFIG_PMW3610_SMART_ALGORITHM=y


CONFIG_PMW3610_ALT=y


# CONFIG_PMW3610_AUTOMOUSE_TIMEOUT_MS=250

Expand Down
Loading