21#define CFG_MAGIC 0x43574341u
23#define CFG_PARAM_SLOTS 48u
60uint32_t
cfg_crc32(
const void *data, uint32_t len);
Sensor calibrations of protocol v2 (HANDOVER_FW.md §10).
int cfg_save(cfg_image_t *img)
writes img (seq and crc filled here) to the other page; 0 = ok
#define CFG_PARAM_SLOTS
room for parameters added later
const void * cfg_flash_page(int page)
memory-mapped page
int cfg_flash_write(int page, const void *data, uint32_t len)
erase + program; 0 = ok
void cfg_params_put(cfg_image_t *img, const float values[PARAM_COUNT])
parameters <-> slots (unknown ids ignored, missing ids -> default)
void cfg_params_get(const cfg_image_t *img, float values[PARAM_COUNT])
uint32_t cfg_crc32(const void *data, uint32_t len)
int cfg_load(cfg_image_t *out)
latest valid image (version 1 converted); returns 0 if found, -1 if none (out left untouched)
Drone parameters of protocol v2 (HANDOVER_FW.md §8, ids.ts PARAMS).
uint32_t crc
CRC-32 of everything above
cal_set_t bak
previous set, per type (CAL_RESTORE)
float batt_used_scale_i
current scale it was counted with
float batt_used_mah
charge used in the last flight
cal_set_t cal
saved calibrations
uint32_t bak_mask
bit (type-1): bak holds a set for it
one parameter: stored by id, so the table can grow without a migration
uint16_t id
0 = empty slot