Skip to content

feat: add an amber hold state and an e-stop input without the pull-up - #4

Merged
CameronBrooks11 merged 2 commits into
mainfrom
feat/amber-hold-and-estop-input-mode
Nov 1, 2026
Merged

CameronBrooks11 merged 2 commits into
mainfrom
feat/amber-hold-and-estop-input-mode

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Closes #3.

  • bsc::StatusLed gains a Hold state, amber (red 50, green 16), for a command-watchdog trip or a latched fault. StatusLed::stateFor(estopHeld, hold) picks the main loop's state, with red winning over amber. The amber ratio is worked from the WS2812B datasheet's typical intensities and hasn't been seen on a board yet.
  • bsc::EStop gains EStop(pin, EStop::NoPullUp), which asserts on LOW without the internal pull-up, for a Loaf that pulls an open line LOW (The e-stop chain is not fail-safe on current boards bread-infra#20). The existing constructor, with the pull-up, is unchanged and stays the default.

Both are additive. Slice_DCMT (d461d04) and Slice_RLHT (f6b0318) build unchanged against this branch on all four envs.

Tests (ctest, 4/4 pass): the Hold frame is GRB (16, 50, 0); stateFor over all four inputs, including e-stop and hold together giving red; NoPullUp sets INPUT and makes no pull-up request (the fake now counts them); the default still sets INPUT_PULLUP. Each check fails when its behaviour is broken: amber value changed, hold checked before the e-stop, the pull-up enabled in NoPullUp, and the default losing its pull-up.

No version bump here; the release is a separate step.

The Slice firmware standard shows amber for a firmware hold: a
command-watchdog trip or a latched fault. StatusLed had only blue, green
and red, so a trip showed green.

Add a Hold state (red 50, green 16) and StatusLed::stateFor(), which
picks the main loop's state with red winning over amber. The amber
ratio is worked from the WS2812B datasheet's typical intensities, not
seen on a board. The example now shows amber on a watchdog trip.

Refs #3
The e-stop polarity rule has the Loaf pull an open line LOW and each
Slice read it with no internal pull-up: pull-ups on several Slices in
parallel would hold an open line HIGH against the pull-down.

Add EStop(pin, EStop::NoPullUp), which asserts on LOW without the
pull-up. The existing constructor, with the pull-up, is unchanged and
stays the default, since today's Loafs have no pull-down. The host fake
now counts pull-up requests, so the test can show the new mode never
enables it.

Refs #3
@CameronBrooks11
CameronBrooks11 marked this pull request as ready for review November 1, 2026 01:44
@CameronBrooks11
CameronBrooks11 merged commit b16a21e into main Nov 1, 2026
3 checks passed
@CameronBrooks11
CameronBrooks11 deleted the feat/amber-hold-and-estop-input-mode branch November 1, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an amber hold state and an e-stop input without the pull-up

1 participant