feat: command watchdog — relays off when the bus goes silent#6
Merged
Conversation
Implement the disarmed-by-default bus-liveness watchdog (#5) against bread-crumbs-contracts 0.4.5's shared vocabulary, mirroring the Slice_DCMT implementation (feastorg/Slice_DCMT#8): - BREAD_OP_SET_WATCHDOG handler arms/disarms ([timeout_ms:u16], 0 = disarm); firmware boots disarmed unless -DRLHT_WATCHDOG_BOOT_MS is set, so standalone/serial use is unaffected by default. - Liveness stamping: CRUMBS on_message callback, GET_WATCHDOG reply build, and serial CLI commands refresh wdLastRxMs; a valid command frame clears a trip. - watchdogLogic() in the main loop: on expiry, drive both relays LOW and zero setpoints/on-times (same safe-state set as processEStop, estop untouched), latch tripped, bump trip_count; relayControlLogic() holds the e-stop-equivalent safe state while tripped. - BREAD_OP_GET_WATCHDOG reply reports [armed][timeout_ms][tripped][trip_count]; caps now advertise RLHT_CAP_CMD_WATCHDOG (bit 6). - Serial CLI: WDOG=<ms> (0 = off); status output gains WDOG/WDTRIP. Masked windows stay within the short-cli-window discipline (feastorg/Slice_DCMT#3). Builds verified on all four envs. Closes #5
CameronBrooks11
added a commit
to anolishq/anolis-projects
that referenced
this pull request
Jul 18, 2026
RLHT firmware with CMD_WATCHDOG support (feastorg/Slice_RLHT#6) is now flashed on the bench board, so arm it like the dcmt devices (#40).
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.
Implements #5 against bread-crumbs-contracts 0.4.5, mirroring feastorg/Slice_DCMT#8 — see the commit message for the mechanism. Key layering guarantees: boots disarmed (standalone/serial unaffected), armed only by a controller via
BREAD_OP_SET_WATCHDOG, trip = e-stop-equivalent safe state (relays LOW, setpoints/on-times zeroed) held until fresh traffic,RLHT_CAP_CMD_WATCHDOG(bit 6) advertised for feature detection. The bread provider side (anolishq/anolis-provider-bread#113) works unchanged for RLHT once this is flashed — the helper is type-agnostic via the caps flag. All four PIO envs build against registry 0.4.5. Bench note: no heater is connected on the current bench, so live validation is a relay-click test at most; the DCMT kill-test validates the shared mechanism.