|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The render loop's watchdog. More...
Functions | |
| void | frame_watch_init (frame_watch_t *w, uint32_t count, uint32_t now_ms) |
Start watching from count at now_ms. | |
| 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. | |
| 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. | |
| void frame_watch_init | ( | frame_watch_t * | w, |
| uint32_t | count, | ||
| uint32_t | now_ms ) |
Start watching from count at now_ms.
| w | Watch state. |
| count | The render loop's counter now. |
| now_ms | Current time, in milliseconds. |
| 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.
A counter that differs from the last look has moved, whatever the difference, so a counter that wraps through 0 moves. The time is taken modulo 2^32ms. True once per stall, on the first look at or past FRAME_WATCH_MS from the last move with armed or supply_on; the next stall begins at the next move.
| w | Watch state. |
| count | The render loop's counter now. |
| armed | The bench is ARMED. |
| supply_on | The supply's output is on. |
| now_ms | Current time, in milliseconds. |
| 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.
| w | Watch state. |
| now_ms | Current time, in milliseconds. |