Module journal

Module journal 

Source
Expand description

Two-page rotating journal handles, generic over the board’s flash.

umsh-journal-store owns the record formats and the committed-write engine; this module owns the runtime handle wrapped around them — the mount scan, the write-target rotation, and the boot path’s walk-back. Both were previously duplicated in each firmware, identical except for which flash driver they closed over.

The only genuinely per-board fact is that flash type: the nRF images drive MPSL-coordinated NVMC, the ESP32 image its SPI flash part. It enters as the F parameter, bounded by the umsh-journal-store traits the board already implements, and a board’s fault-injection hooks stay in its own trait impls where they belong.

Structs§

ProtoStore
Runtime handle for one full-protocol record journal: the snapshot journal, the device-identity journal, the device-node counter journal, or a board’s own preferences journal — selected by its first page. Executes durable effects; a caller’s RAM mirror is only updated after these return.

Traits§

JournalFlash
Everything a journal needs from a board’s flash. Blanket-implemented, so a board implements the three umsh-journal-store traits and gets this for free.

Functions§

journal_write_target
Pick the write target for a two-page rotating journal starting at page0: the next erased slot after the current record, or the opposite page after erasing it.

Type Aliases§

BootPayload
The stored protocol payload as read at boot.
SharedFlash
One flash driver shared between every journal on the board, behind the async mutex that serializes access to it.