]>
git.scottworley.com Git - tattlekey/blob - client/press.h
6cd4c5b7faa5cfacf0d5cfa1f65c62d0019efe8a
4 #include "pico/cyw43_arch.h"
5 #include "pico/util/pheap.h"
6 #include "pico/util/queue.h"
15 /* Queues of various sizes that hold presses. There is one queue for each
19 /* Tracks when each queue will be next ready-to-send. Empty queues are not in
23 /* The companion-array for the heap. */
28 press_pile_t
*create_press_pile();
30 /* Adds this press to the pile.
31 * Copies the contents of `press`. */
32 void add_press(press_pile_t
*pp
, press_t
*press
);
34 /* When do we next need to send something (in seconds since boot)?
35 * Returns -1 if there's nothing pending. */
36 int32_t next_scheduled_send(press_pile_t
*pp
);
38 /* Find a press ready for resend at or before `now`.
39 * Move it out of the press-pile `pp` and into into `press`.
40 * Or return false if there is no press due for re-send. */
41 bool get_press_due_for_resend(press_pile_t
*pp
, uint32_t now
, press_t
*press
);