|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The write art_store_put() does, cut into steps of at most one sector each, so a caller can stop between any two and carry on later. More...
#include <art_store.h>
Data Fields | |
| const art_flash_t * | f |
| const uint8_t * | payload |
| art_entry_t | entry |
| uint16_t | board |
| uint8_t | phase |
| uint32_t | at |
| uint32_t | span |
| uint32_t | done |
| uint16_t | crc |
| uint32_t | hash |
| uint8_t | buf [ART_KEEP_READ_BYTES] |
The write art_store_put() does, cut into steps of at most one sector each, so a caller can stop between any two and carry on later.
The steps, in order: choose the slot; erase each sector the header and the payload occupy, the header's first; write the payload a sector at a time; read it back a sector at a time against the entry's checksum; write the header. The header's sector is erased before anything else is written and the header is written last, so a keep stopped between any two steps – or never resumed, by a power cut – leaves nothing findable for the board. Resumed, it carries on from the step it stopped before: what it already wrote is still in flash, because nothing else writes the slot in between.
Owned by one caller; the payload must stay valid and unchanged until the keep is DONE or FAILED.
| uint32_t art_keep_t::at |
the slot's offset
| uint8_t art_keep_t::buf[ART_KEEP_READ_BYTES] |
the chunk read back from flash
| uint16_t art_keep_t::crc |
of what has been read back so far
| uint32_t art_keep_t::done |
bytes of the phase done
| uint32_t art_keep_t::hash |
the same, link_fnv1a32()
| uint8_t art_keep_t::phase |
see art_store.c
| uint32_t art_keep_t::span |
bytes from the slot's start to erase