Expand description
Display-attention policy: when the device should stop assuming the user is looking at it.
Both panel technologies lapse after a period of inactivity; what lapsing does differs, because their costs differ:
DisplayKind::Emissive(OLED) burns current for as long as it is lit, so lapsing turns the panel off — via a dimmed warning state first, so it reads as going to sleep rather than dying.DisplayKind::Persistent(e-paper) costs nothing to keep readable, so it stays visible. Lapsing instead collapses the menu back to its home page.
The shared part is the one that matters to the user: after a while
away, the device forgets what you were in the middle of, and the next
press starts from a page whose meaning is visible. Both kinds
therefore send the menu home on Transition::Lapsed (see
crate::menu::UiModel::go_home); only emissive panels also cut
power.
§Driving it
- Call
Attention::wakeon every event that means “the user is here or wants to be”: a button press (on the press edge, not the release), a BLE connection-state change, an opening pairing window, an alert, a low-battery notice. - Call
Attention::set_holdfor conditions that must stay visible for as long as they last, such as a pairing window showing a PIN. - Call
Attention::pollwhenAttention::next_deadlineelapses, and act on anyTransitionit returns.
Content changes that are not the user’s doing — a battery sample, a
bond count — must not call wake. Redraw them only while
Attention::accepts_redraw is true, or a board that samples its
battery on a timer will never let its panel sleep.
Structs§
- Attention
- Display-attention state machine.
- Attention
Config - Timing policy. Held by value so a board can adjust it at runtime —
the plumbing a future
PROP_DISPLAY_TIMEOUTneeds.
Enums§
- Display
Kind - How the board’s panel behaves when it is not being looked at.
- Display
State - What the panel is currently doing.
- Hold
Reason - A condition that pins the display awake for as long as it holds.
- Transition
- A state change the owning task has to act on.