rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Toggle main menu visibility
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
39
extern
"C"
{
40
#endif
41
55
#define FRAME_WATCH_MS 1000u
56
58
typedef
struct
{
59
uint32_t
seen
;
60
uint32_t
moved_ms
;
61
bool
fired
;
62
}
frame_watch_t
;
63
71
void
frame_watch_init
(
frame_watch_t
*w, uint32_t count, uint32_t now_ms);
72
89
bool
frame_watch_step
(
frame_watch_t
*w, uint32_t count,
bool
armed,
90
bool
supply_on, uint32_t now_ms);
91
99
uint32_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 */
frame_watch_step
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
frame_watch_still_ms
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
frame_watch_init
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
frame_watch_t
The watch's state; frame_watch_init() sets it up.
Definition
frame_watch.h:58
frame_watch_t::moved_ms
uint32_t moved_ms
Definition
frame_watch.h:60
frame_watch_t::fired
bool fired
Definition
frame_watch.h:61
frame_watch_t::seen
uint32_t seen
Definition
frame_watch.h:59
shared
safety
include
frame_watch.h
Generated by
1.18.0