Expand description
LED sequence engine.
Owns the heartbeat (always-on; never suppressed) and arbitrates one-shot sequences layered on top: power-on, power-off, location advert.
Pure logic over a monotonic-millisecond clock. The engine reports the
LED state to apply right now and the absolute time at which the
caller should re-invoke LedEngine::tick for the next transition.
No async, no I/O — fully unit-testable with synthetic time.
§Heartbeat semantics
The heartbeat is anchored at the engine’s start time. After every
heartbeat_interval, the LED pulses for heartbeat_pulse (defaults:
2 s and 50 ms). When a one-shot sequence is active it preempts the
heartbeat for the sequence’s duration; once the sequence completes
the heartbeat resumes on its original rhythm (i.e. it is not
re-anchored), so the user-perceived 2-second cadence stays consistent
across overlays.
Structs§
- Brightness
Decision - PWM brightness decision for the T1000-E’s state-aware indicator.
- LedDecision
- The result of a
LedEngine::tick: the LED state to apply now and the absolute monotonic-millisecond deadline at which to tick again. - LedEngine
- LED sequence engine.
- LedTimings
- Tunable heartbeat timings.
- Pattern
- A pre-computed LED pattern.
stepsis an alternating list of durations starting with the ON phase:[on_0, off_0, on_1, off_1, ...]. - T1000e
LedEngine - State-aware T1000-E LED policy. One-shot confirmations preempt persistent state; Charging and Low Battery preempt Attention; Attention replaces only the ordinary heartbeat.
Enums§
- LedSequence
- A one-shot LED flash sequence.
Constants§
- DIM_
FULL_ MLUX - Illuminance at or above which the indicator runs at full brightness: 10 lux, in millilux.
- DIM_
MIN_ PERMILLE - The dimming floor, in permille of normal brightness: 1/20th. Reached at zero illuminance.
Functions§
- ambient_
dim_ permille - Ambient dimming scale, in permille of normal brightness: 1000 at or
above
DIM_FULL_MLUX, falling linearly toDIM_MIN_PERMILLEat zero.None— no reading yet — is full brightness, so a board whose sensor never answers keeps its ordinary indicator.