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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[target.thumbv7em-none-eabihf]
runner = "probe-rs run --chip ATSAME54P20A"
rustflags = ["-C", "link-arg=-Tlink.x"]

[build]
target = "thumbv7em-none-eabihf"

[env]
DEFMT_LOG = "debug"
79 changes: 56 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,68 @@ name: CI

on:
push:
branches: [main, master]
branches: [main]
pull_request:
branches: [main, master]
branches: [main]

env:
CARGO_TERM_COLOR: always

jobs:
build-and-test:
fmt:
name: Format
runs-on: ubuntu-latest

permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ libboost-dev lcov

- name: Build
run: make build
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run cargo fmt
run: cargo fmt --all
- name: Commit formatting changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style: apply cargo fmt"
branch: ${{ github.head_ref }}

- name: Test
run: make test
check:
name: Check
needs: fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: thumbv7em-none-eabihf
- uses: Swatinem/rust-cache@v2
- run: cargo check --workspace

- name: Generate coverage report
run: make coverage
test:
name: Test
needs: fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: thumbv7em-none-eabihf
- uses: Swatinem/rust-cache@v2
- run: cargo test -p gcode-parser --target x86_64-unknown-linux-gnu

- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
clippy:
name: Clippy
needs: fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
name: coverage-report
path: build/coverage/
retention-days: 30
targets: thumbv7em-none-eabihf
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace -- -D warnings
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
43 changes: 43 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# CLAUDE.md

## Project

Multi-board 3D printer firmware using Embassy async actors.
Supports Duet 3 Mini 5+ (ATSAME54P20A), BTT EBB42 (STM32G0B1), and BTT SKR Pico (RP2040).

## Build

```bash
cargo check --workspace # type-check all crates
cargo test --workspace \
--exclude duet3-firmware --exclude ebb42-firmware --exclude pico-firmware \
--exclude actor-framework --exclude wasm-sim \
--target x86_64-unknown-linux-gnu # run all tests on host
cargo clippy --workspace # lint
cargo fmt --all # format
```

## Architecture

Portable library crates with HAL trait boundary:
- `printer-hal` — trait definitions (StepperDriver, TemperatureSensor, etc.)
- `gcode-parser` — zero-allocation G-code parsing
- `dispatcher` — command routing (gcode → motion/thermal/sdcard actors)
- `motion-planner` — trapezoidal profiles + Bresenham step generator
- `thermal` — PID controller + heater/fan manager
- `sdcard` — line reader + file protocol
- `actor-framework` — Embassy-based mailbox/event bus
Board-specific pin mapping crates:
- `board-hal` — Duet 3 Mini 5+ (ATSAME54P20A) pin mappings + TMC2209
- `board-ebb42` — BTT EBB42 v1.2 (STM32G0B1CBT6) CAN toolboard pins
- `board-pico` — BTT SKR Pico v1.0 (RP2040) mainboard pins

Binary crates (thin hardware wiring layers):
- `firmware/` — Duet 3 Mini 5+ mainboard firmware
- `firmware-ebb42/` — EBB42 CAN toolboard firmware (stepper + thermal + CAN)
- `firmware-pico/` — SKR Pico mainboard firmware (full stack)
- `wasm-sim/` — mock HAL impls for browser/host testing

## Pull Request Policy

Pull requests should be automatically merged when all CI checks pass. Use `gh pr merge --auto --squash` after creating a PR to enable auto-merge.
37 changes: 0 additions & 37 deletions CMakeLists.txt

This file was deleted.

Loading