Repository navigation
feat: add an amber hold state and an e-stop input without the pull-up - #4
Merged
Merged
Conversation
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
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.
Closes #3.
bsc::StatusLedgains aHoldstate, 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::EStopgainsEStop(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);
stateForover all four inputs, including e-stop and hold together giving red;NoPullUpsets 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 inNoPullUp, and the default losing its pull-up.No version bump here; the release is a separate step.