9static volatile uint32_t
s_seq;
34 for (
int tries = 0; tries < 8; ++tries) {
35 const uint32_t s0 =
s_seq;
36 if (s0 & 1u)
continue;
40 if (
s_seq == s0) { *out = v;
return; }
int fsh_cal_push(const cal_sample_t *s)
int fsh_apply_take(fsh_apply_t *a)
volatile uint8_t g_fsh_cal_want
calibration samples (ImuTask -> AppTask)
int fsh_apply_post(uint8_t type, const cal_set_t *set)
void fsh_est_write(const fsh_est_t *s)
ImuTask.
int fsh_cal_pop(cal_sample_t *s)
static volatile uint32_t s_seq
void fsh_est_read(fsh_est_t *out)
AppTask: keeps *out on a race.
Data exchanged between the flight context (ImuTask) and the AppTask.
Lock-free single-producer single-consumer queue of fixed-size items.
#define SPSC_DEFINE(name, type, n)
static int spsc_push(spsc_t *q, const void *it)
static void spsc_reset(spsc_t *q)
static int spsc_pop(spsc_t *q, void *it)
calibration to apply (AppTask -> ImuTask)