rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
frame_watch.h
Go to the documentation of this file.
1
31
32#ifndef RCBENCH_FRAME_WATCH_H
33#define RCBENCH_FRAME_WATCH_H
34
35#include <stdbool.h>
36#include <stdint.h>
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
55#define FRAME_WATCH_MS 1000u
56
58typedef struct {
59 uint32_t seen;
60 uint32_t moved_ms;
61 bool fired;
63
71void frame_watch_init(frame_watch_t *w, uint32_t count, uint32_t now_ms);
72
89bool frame_watch_step(frame_watch_t *w, uint32_t count, bool armed,
90 bool supply_on, uint32_t now_ms);
91
99uint32_t frame_watch_still_ms(const frame_watch_t *w, uint32_t now_ms);
100
101#ifdef __cplusplus
102}
103#endif
104
105#endif /* RCBENCH_FRAME_WATCH_H */
bool frame_watch_step(frame_watch_t *w, uint32_t count, bool armed, bool supply_on, uint32_t now_ms)
One look at the counter: whether the bench is to be stopped now.
Definition frame_watch.c:24
uint32_t frame_watch_still_ms(const frame_watch_t *w, uint32_t now_ms)
How long the counter has stood still, at now_ms.
Definition frame_watch.c:44
void frame_watch_init(frame_watch_t *w, uint32_t count, uint32_t now_ms)
Start watching from count at now_ms.
Definition frame_watch.c:14
The watch's state; frame_watch_init() sets it up.
Definition frame_watch.h:58
uint32_t moved_ms
Definition frame_watch.h:60
bool fired
Definition frame_watch.h:61
uint32_t seen
Definition frame_watch.h:59