Skip to content

feat: command watchdog — relays off when the bus goes silent#6

Merged
CameronBrooks11 merged 1 commit into
mainfrom
feat/command-watchdog
Jul 18, 2026
Merged

feat: command watchdog — relays off when the bus goes silent#6
CameronBrooks11 merged 1 commit into
mainfrom
feat/command-watchdog

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

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.

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
CameronBrooks11 merged commit c2c9159 into main Jul 18, 2026
5 checks passed
@CameronBrooks11
CameronBrooks11 deleted the feat/command-watchdog branch July 18, 2026 00:21
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).
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.

1 participant