Hardware variants and Soft-AP programming mode - #2
Merged
Conversation
Separate ControlSurface / UiShell / Presenter per board family (LongFred standard+mini, markwtech, heiko-wifred), add Shift+Stop pairing over longfred_prog_* with HTTP settings API and config page, and build all variants in CI. Co-authored-by: Cursor <cursoragent@cursor.com>
- Add `[workspace.lints]` (rust + clippy) with `unsafe_code = warn`,
`missing_docs = warn`, `unused_must_use = deny`, and deny lints for
`unwrap_used`/`expect_used`/`panic`/`dbg_macro`/`todo`/`unimplemented`.
Both crates adopt the policy via `[lints] workspace = true`.
- Add a `clippy` CI job that runs per-variant (mutually exclusive features
cannot use `--all-features`); rustfmt check added to the `test` job.
- Replace `expect("WifiController::new")` in `main.rs` with a typed
error path that logs and hangs instead of panicking.
- Add `SAFETY:` justification to each `unsafe { AnyPin::steal(...) }`
block in `led_presenter.rs` (single-owner invariant established in
`main` before any other task runs).
- Replace `apply_settings_put`'s `bool` return with a typed
`ApplyError` enum; HTTP 400 now reports the offending field.
- Remove the no-op `UiShell` impl from `HeadlessShell` (the domain task
uses `HeadlessShell::handle`, which returns `Intent`).
- Fix `MarkwtechNav`: `*` now maps to `Cancel` inside menus (previously
`MenuEnter`), and to `MenuEnter` only on the throttle screen. Adds an
`on_throttle: bool` parameter to `NavProfile::map`.
- Document `map_fn_key` `# Panics` and simplify the shift offset logic.
- Validate `LocoSlot(slot, ...)` at the `ControlSurface` boundary
(ignore `slot == 0`) so downstream code does not repeat the check.
- Check `fmt::Write` result in `respond()` instead of `let _ =`.
- Add negative tests for `bigfred.login` and `roster.mode` mismatches
in the wireless-programmer `longfred` driver.
- Document the `Content-Length` requirement and 1536-byte body limit
in `docs/provisioning.md`.
- Apply `cargo fmt --all` to fix pre-existing formatting drift.
Co-authored-by: Cursor <cursoragent@cursor.com>
Makefile can build one or all hardware variants; CI verifies flash/RAM against the C6 budget from uploaded artifacts without rebuilding. Co-authored-by: Cursor <cursoragent@cursor.com>
Allow incremental missing_docs (matching CI), document crate roots, gate test-only imports, and justify AnyPin::steal with SAFETY + allow(unsafe_code). Co-authored-by: Cursor <cursoragent@cursor.com>
Add missing docs and SAFETY comments, gate test-only imports, and use grep instead of rg in the size script so GitHub Actions has no extra deps. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
longfred-standard,longfred-mini,markwtech,heiko-wifred) with sharedControlSurface/UiShell/Presenterseparation; LongFred standard and mini share one family module and differ only by OLED geometry.longfred_prog_XXXXXX,192.168.0.1) with HTTP API (GET /,GET|PUT /api/v1/settings,POST /api/v1/programming-mode/off) and static pairing page; heiko auto-pairs when Wi-Fi NVS is empty.Test plan
cargo test -p longfred-proto --target x86_64-unknown-linux-gnucargo check -p longfred-firmware(default / standard)cargo check -p longfred-firmware --no-default-features --features variant-longfred-minicargo check -p longfred-firmware --no-default-features --features variant-markwtechcargo check -p longfred-firmware --no-default-features --features variant-heiko-wifredhttp://192.168.0.1/Made with Cursor