rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
fw_trial.h
Go to the documentation of this file.
1
31
32#ifndef RCBENCH_FW_TRIAL_H
33#define RCBENCH_FW_TRIAL_H
34
35#include <stdbool.h>
36#include <stdint.h>
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
43#define FW_TRIAL_CARD 0x01u
45#define FW_TRIAL_SETTINGS 0x02u
47#define FW_TRIAL_CONTROL 0x04u
49#define FW_TRIAL_LOGGER 0x08u
51#define FW_TRIAL_FRAME 0x10u
53#define FW_TRIAL_TICK 0x20u
55#define FW_TRIAL_ALL 0x3Fu
56
61#define FW_TRIAL_BOUND_MS 30000u
62
70
72typedef struct {
73 uint32_t start_ms;
74 uint32_t done;
75 bool bound;
76 bool settled;
78
84void fw_trial_init(fw_trial_t *t, uint32_t start_ms);
85
93void fw_trial_mark(fw_trial_t *t, uint32_t steps);
94
101
113fw_trial_verdict_t fw_trial_poll(fw_trial_t *t, uint32_t now_ms, bool quiet);
114
120uint32_t fw_trial_missing(const fw_trial_t *t);
121
122#ifdef __cplusplus
123}
124#endif
125
126#endif /* RCBENCH_FW_TRIAL_H */
fw_trial_verdict_t fw_trial_poll(fw_trial_t *t, uint32_t now_ms, bool quiet)
Decide at now_ms. FW_TRIAL_KEEP and FW_TRIAL_KEEP_BOUND settle the trial: each is returned once.
Definition fw_trial.c:33
void fw_trial_init(fw_trial_t *t, uint32_t start_ms)
Start a trial with no step seen.
Definition fw_trial.c:11
void fw_trial_settle(fw_trial_t *t)
Settle the trial outside this model, as the start without touch does; every later poll says FW_TRIAL_...
Definition fw_trial.c:28
uint32_t fw_trial_missing(const fw_trial_t *t)
The steps not seen yet.
Definition fw_trial.c:56
void fw_trial_mark(fw_trial_t *t, uint32_t steps)
Record steps as seen. FW_TRIAL_TICK counts only once FW_TRIAL_FRAME is seen, before this call or in i...
Definition fw_trial.c:17
fw_trial_verdict_t
What fw_trial_poll() decides.
Definition fw_trial.h:64
@ FW_TRIAL_SETTLED
Definition fw_trial.h:68
@ FW_TRIAL_OPEN
Definition fw_trial.h:65
@ FW_TRIAL_KEEP
Definition fw_trial.h:66
@ FW_TRIAL_KEEP_BOUND
Definition fw_trial.h:67
One trial: the steps seen and whether it is settled.
Definition fw_trial.h:72
bool bound
Definition fw_trial.h:75
uint32_t done
Definition fw_trial.h:74
bool settled
Definition fw_trial.h:76
uint32_t start_ms
Definition fw_trial.h:73