49#define LOG_CADENCE_MODEL_MS 50u
57#define LOG_CADENCE_MODEL_MAX_MS 1000u
94 return kind == LOG_RUN_SERVO || kind == LOG_RUN_MOTOR;
116 bool supply_on, log_run_kind_t now);
184 bool bench_run,
float *t_s);
log_run_kind_t log_cadence_wanted(bool auto_logs, bool armed, bool motor, bool supply_on, log_run_kind_t now)
The run the log records now, from the run it records (now) and the bench: LOG_RUN_NONE while auto_log...
Definition log_cadence.c:86
void log_cadence_init(log_cadence_t *c, uint32_t now_ms)
Once, before the loop: both clocks at now_ms, no rows counted.
Definition log_cadence.c:10
void log_cadence_posted(log_cadence_t *c, bool taken)
What the logger's queue did with a row: taken, or refused as full.
Definition log_cadence.c:67
uint32_t log_cadence_lost(const log_cadence_t *c)
The run's rows the queue refused.
Definition log_cadence.c:81
bool log_cadence_model_due(log_cadence_t *c, uint32_t now_ms, bool link_up, float *step_s)
The model's gate, once per pass.
Definition log_cadence.c:16
static bool log_run_armed(log_run_kind_t kind)
Whether kind is a run of the armed bench, whichever screen armed it.
Definition log_cadence.h:92
bool log_cadence_bench_run(bool bench_kind, bool servo_test)
Whether the bench log records in this pass: the log's run is an armed bench's (bench_kind) and no aut...
Definition log_cadence.c:43
uint32_t log_cadence_sent(const log_cadence_t *c)
The run's rows the queue took.
Definition log_cadence.c:76
bool log_cadence_row(log_cadence_t *c, uint32_t now_ms, bool new_sample, bool bench_run, float *t_s)
Whether this pass writes a bench row, once per pass and on every pass, with now_ms never behind the c...
Definition log_cadence.c:48
void log_cadence_run_start(log_cadence_t *c, uint32_t now_ms)
A run starts: its time is 0 at now_ms and its row counts are 0.
Definition log_cadence.c:35
unsigned log_cadence_rows(unsigned windows)
How many rows a pass writes that log_cadence_row() granted: one for each of the windows INA3221 windo...
Definition log_cadence.c:62
The cadence state of the run log: its clocks and row counts.
Definition log_cadence.h:62
uint32_t sent
Definition log_cadence.h:66
uint32_t seen_ms
Definition log_cadence.h:64
uint32_t model_ms
Definition log_cadence.h:63
uint64_t run_ms
Definition log_cadence.h:65
uint32_t lost
Definition log_cadence.h:67