Files
jiggly/Cargo.toml
T
swaitsandClaude Opus 4.7 c45fceaf7a chore: cut 0.3.0 — new tuning crate, retuned lifecycle constants
- Adds an in-repo `tuning/` crate that solves the four-knob LED-threshold
  tuning problem as a 4-objective Pareto search using published
  `heuropt` 0.8 (NSGA-III + a-posteriori weighted ranking), replacing
  `scripts/tune_runtime.py`'s single-composite-score grid. `just tune`
  runs it; the crate is its own workspace root with a local
  `.cargo/config.toml` overriding the firmware's inherited
  `thumbv6m-none-eabi` build target so it can use `std`.
- Retunes the shipping defaults from the new Pareto front:
  `RUN_DURATION` 4h00m → 3h51m, `YELLOW_AT` 30 → 22, `RED_AT` 25 → 11,
  `FAST_RED_AT` 20 → 4 (LED thresholds in minutes-remaining). Across
  1,000 simulated workdays the new combination averages 26 minutes of
  lunch sleep and lands in the 12:15–12:45 sweet spot on ~57 % of days,
  with zero mean work-time failure and ~2 min/day of after-hours waste.
- Bumps `config.device_release` 0x0200 → 0x0300 to match firmware
  version 0.3.0.
- README "Why four hours…" → "Why these timings…", rewritten for the
  new methodology with the actual run statistics. `src/config.rs`
  module-level + lifecycle/phase comments updated accordingly.
- Picks up a small `cargo fmt` drift in `src/chart.rs` and `src/led.rs`
  that had crept in under the 0.2.0 module split.

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

77 lines
3.5 KiB
TOML

[package]
name = "jiggly"
version = "0.3.0"
edition = "2024"
authors = ["Stephen Waits <steve@waits.net>"]
description = "USB mouse jiggler firmware for the Seeed Studio Xiao RP2040 — keeps your screen awake during the workday, then politely shuts up so you can go home."
license = "MIT"
repository = "https://github.com/swaits/jiggly"
readme = "README.md"
keywords = ["embedded", "rp2040", "usb-hid", "embassy", "no-std"]
categories = ["embedded", "no-std"]
publish = false # firmware binary; not a crates.io library
[features]
default = ["embassy", "panic-reset"]
# `hsmc` emits `#[cfg(feature = "embassy")]` from inside `statechart!` and
# the cfg is evaluated in this crate's context, so we mirror the flag here
# and forward it to `hsmc/embassy`.
embassy = ["hsmc/embassy"]
# Default panic handler — silently resets the chip. Mutually exclusive with
# `defmt` (which uses panic-probe). Build a defmt firmware with
# `cargo build --no-default-features --features embassy,defmt`.
panic-reset = ["dep:panic-reset"]
# Same trick as `embassy` above: `hsmc` emits `#[cfg(feature = "trace-defmt")]`
# from inside `__chart_observe!` (re-exported via `statechart!`), and that
# cfg is evaluated in *this* crate's feature set, not hsmc's. So we mirror
# the flag here and forward it to `hsmc/trace-defmt`. Without this mirror,
# `--features defmt` would compile cleanly but emit zero state-transition
# logs, because every defmt arm in __chart_observe! would be cfg'd out.
trace-defmt = ["hsmc/trace-defmt"]
# Debug build over RTT. Pulls in defmt + defmt-rtt, swaps the panic handler
# for panic-probe (so panics get printed instead of silently resetting), and
# turns on hsmc's chart/state/transition tracing.
defmt = [
"dep:defmt",
"dep:defmt-rtt",
"dep:panic-probe",
"trace-defmt",
]
[dependencies]
embassy-executor = { version = "0.10.0", features = ["platform-cortex-m", "executor-thread"] }
embassy-time = { version = "0.5.1" }
embassy-rp = { version = "0.10.0", features = ["rp2040", "time-driver", "critical-section-impl", "unstable-pac"] }
embassy-sync = "0.8"
embassy-futures = "0.1"
embassy-usb = "0.6.0"
hsmc = { version = "0.6.0", default-features = false }
usbd-hid = "0.10.0"
smart-leds = "0.4"
libm = "0.2"
cortex-m = { version = "0.7.6", features = ["inline-asm"] }
cortex-m-rt = "0.7.5"
panic-reset = { version = "0.1", optional = true }
static_cell = "2.1"
# Cortex-M0+ has no hardware CAS; static_cell + heapless need this shim.
portable-atomic = { version = "1.13", features = ["critical-section"] }
# Defmt stack — only linked when the `defmt` feature is enabled.
defmt = { version = "0.3", optional = true }
defmt-rtt = { version = "0.4", optional = true }
panic-probe = { version = "0.3", features = ["print-defmt"], optional = true }
[lints.rust]
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(feature, values("tokio", "embassy"))'] }
[profile.release]
lto = "fat" # cross-crate inlining and dead-code elimination
opt-level = "z" # optimise for size over speed (vs "s")
codegen-units = 1 # single unit so LTO sees everything
debug = 2 # symbols stay in the ELF for `just bloat` /
# `just size`; `cargo objcopy -O binary` strips
# them when producing the flashable .bin / .uf2
overflow-checks = false
panic = "abort" # no unwinding tables; panic-reset just resets