rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
out_store_map.h
Go to the documentation of this file.
1
54
55#pragma once
56
57#include <stdbool.h>
58#include <stdint.h>
59
61typedef struct {
62 bool erased;
63 bool valid;
64 uint32_t seq;
66
68typedef struct {
69 uint8_t at;
70 uint32_t seq;
72 uint8_t erase_sector;
74
94int out_store_map_newest(const out_store_rec_t *recs, uint8_t sectors,
95 uint8_t per_sector);
96
118bool out_store_map_write(const out_store_rec_t *recs, uint8_t sectors,
119 uint8_t per_sector, out_store_write_t *out);
120
140bool out_store_map_write_keep(const out_store_rec_t *recs, uint8_t sectors,
141 uint8_t per_sector, int keep,
142 out_store_write_t *out);
143
160int out_store_map_stale(const out_store_rec_t *recs, uint8_t sectors,
161 uint8_t per_sector);
162
173int out_store_map_stale_keep(const out_store_rec_t *recs, uint8_t sectors,
174 uint8_t per_sector, int keep);
175
200bool out_store_intact(uint32_t zeros, uint32_t zeros_inv, uint32_t counted);
int out_store_map_stale_keep(const out_store_rec_t *recs, uint8_t sectors, uint8_t per_sector, int keep)
The same, never offering sector keep while no record is valid (see out_store_map_write_keep()).
Definition out_store_map.c:155
bool out_store_map_write_keep(const out_store_rec_t *recs, uint8_t sectors, uint8_t per_sector, int keep, out_store_write_t *out)
The same, with sector keep never erased while no record is valid: it holds the live record of the lay...
Definition out_store_map.c:77
bool out_store_intact(uint32_t zeros, uint32_t zeros_inv, uint32_t counted)
Whether a record was written whole and has stayed as it was written.
Definition out_store_map.c:175
bool out_store_map_write(const out_store_rec_t *recs, uint8_t sectors, uint8_t per_sector, out_store_write_t *out)
Plan the next save.
Definition out_store_map.c:71
int out_store_map_stale(const out_store_rec_t *recs, uint8_t sectors, uint8_t per_sector)
A sector worth erasing now, ahead of the save that would have to wait for it, or -1 when there is non...
Definition out_store_map.c:149
int out_store_map_newest(const out_store_rec_t *recs, uint8_t sectors, uint8_t per_sector)
The live record: the valid one with the highest sequence number.
Definition out_store_map.c:52
One record slot, as the caller found it in flash.
Definition out_store_map.h:61
bool valid
Definition out_store_map.h:63
uint32_t seq
Definition out_store_map.h:64
bool erased
Definition out_store_map.h:62
Where the next save goes.
Definition out_store_map.h:68
uint32_t seq
Definition out_store_map.h:70
uint8_t at
Definition out_store_map.h:69
uint8_t erase_sector
Definition out_store_map.h:72
bool erase_first
Definition out_store_map.h:71