Files
DS5Dongle-OLED-Edition-stea…/.github/workflows/release.yml
T
MarcelineVPQandClaude Opus 4.7 4b6a72b70a rebase: Phase B — trivial files for the v0.6.0 base
Build-system, config, usb, and CI wiring on top of upstream's
v0.6.0-hotfix tree. Build will still fail until Phase C+D land bt.h
accessors that oled.cpp references; that's expected mid-rebase.

CMakeLists.txt: add src/oled.cpp + src/slots.cpp to add_executable,
link hardware_spi, restore OUTPUT_NAME ds5-bridge-oled.

src/config.h: append the 4 OLED Edition Config_body fields
(current_slot + auto_haptics_enable/gain/lowpass). Preserves
upstream's field order for the first 8 fields.

src/config.cpp:
- speaker_volume validity default -100 dB → 0 dB (footgun fix)
- 4 new validity guards for the appended fields with sensible
  defaults (Fallback / 100 % / 160 Hz / slot 0)
- config_default() impl (was declared in upstream's config.h since
  v0.5.4 but never defined; the OLED Edition's "Reset to defaults"
  Settings item calls it)

src/usb.cpp: drop the UAC1 SET_CUR Volume → flash-config sync that
let PipeWire/Pulse silently override the user's saved Spk Vol on
every device reconnect. Borrowed from loteran/DS5Dongle commit
03fa1e4.

src/usb_descriptors.cpp: restore iSerialNumber = STRID_SERIAL.
Upstream's commit e79c762 zeroed it to work around SpecialK (#32),
but that broke Windows device identity (#100) — users lost
per-device volume / app preferences when moving USB ports. The
OLED Edition prioritizes Windows device-identity stability for
the broader user base over SpecialK compat for a narrower one.

.github/workflows/{build,release}.yml: artifact filenames use
ds5-bridge-oled.uf2 (and -debug / -picow variants) per the
OUTPUT_NAME rebrand.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 07:53:41 -06:00

112 lines
4.0 KiB
YAML

name: Build release firmware
on:
release:
types:
- published
env:
PICO_SDK_REF: 2.2.0
TINYUSB_REF: 0.20.0
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
APT_PACKAGES: >-
cmake
python3
build-essential
gcc-arm-none-eabi
libnewlib-arm-none-eabi
libstdc++-arm-none-eabi-newlib
ninja-build
permissions:
contents: write
jobs:
build:
name: Build and upload release UF2
runs-on: ubuntu-latest
steps:
- name: Checkout release ref
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
submodules: recursive
- name: Set firmware version
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: printf 'FIRMWARE_VERSION=%s\n' "$RELEASE_TAG" >> "$GITHUB_ENV"
- name: Prepare build dependency cache
id: apt-cache
run: |
mkdir -p "$RUNNER_TEMP/apt-cache/partial"
. /etc/os-release
package_hash="$(printf '%s' "$APT_PACKAGES" | sha256sum | cut -d ' ' -f 1)"
echo "dir=$RUNNER_TEMP/apt-cache" >> "$GITHUB_OUTPUT"
echo "os=${ID}-${VERSION_ID}" >> "$GITHUB_OUTPUT"
echo "package-hash=$package_hash" >> "$GITHUB_OUTPUT"
- name: Cache build dependencies
uses: actions/cache@v4
with:
path: ${{ steps.apt-cache.outputs.dir }}
key: ${{ runner.os }}-${{ runner.arch }}-apt-${{ steps.apt-cache.outputs.os }}-${{ steps.apt-cache.outputs.package-hash }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-apt-${{ steps.apt-cache.outputs.os }}-
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get -o Dir::Cache::archives="${{ steps.apt-cache.outputs.dir }}" install --download-only -y $APT_PACKAGES
sudo apt-get -o Dir::Cache::archives="${{ steps.apt-cache.outputs.dir }}" install -y $APT_PACKAGES
sudo chmod -R a+rX "${{ steps.apt-cache.outputs.dir }}"
- name: Cache Pico SDK
id: cache-pico-sdk
uses: actions/cache@v4
with:
path: ${{ env.PICO_SDK_PATH }}
key: ${{ runner.os }}-${{ runner.arch }}-pico-sdk-${{ env.PICO_SDK_REF }}-tinyusb-${{ env.TINYUSB_REF }}
- name: Download Pico SDK
if: steps.cache-pico-sdk.outputs.cache-hit != 'true'
run: |
git clone --depth 1 --branch "$PICO_SDK_REF" https://github.com/raspberrypi/pico-sdk.git "$PICO_SDK_PATH"
git -C "$PICO_SDK_PATH" submodule update --init --recursive
- name: Switch TinyUSB to configured tag
run: |
if ! git -C "$PICO_SDK_PATH/lib/tinyusb" rev-parse -q --verify "refs/tags/$TINYUSB_REF" >/dev/null; then
git -C "$PICO_SDK_PATH/lib/tinyusb" fetch --depth 1 origin "refs/tags/$TINYUSB_REF:refs/tags/$TINYUSB_REF"
fi
git -C "$PICO_SDK_PATH/lib/tinyusb" checkout --detach "$TINYUSB_REF"
- name: Build standard firmware
run: |
cmake -S . -B build/standard -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DPICO_SDK_PATH="$PICO_SDK_PATH" \
-DVERSION="$FIRMWARE_VERSION"
cmake --build build/standard --target ds5-bridge
mkdir -p artifacts
cp build/standard/ds5-bridge-oled.uf2 "artifacts/ds5-bridge-oled-${{ github.event.release.tag_name }}.uf2"
- name: Build Debug firmware
run: |
cmake -S . -B build/debug -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DPICO_SDK_PATH="$PICO_SDK_PATH" \
-DENABLE_SERIAL=ON \
-DENABLE_VERBOSE=ON \
-DVERSION="$FIRMWARE_VERSION"
cmake --build build/debug --target ds5-bridge
cp build/debug/ds5-bridge-oled.uf2 "artifacts/ds5-bridge-oled-debug-${{ github.event.release.tag_name }}.uf2"
- name: Upload UF2 files to release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload "${{ github.event.release.tag_name }}" artifacts/*.uf2 --clobber