]> git.scottworley.com Git - tattlekey/blame - client/press.h
client: Bundle press_t[] & pheap_t* together as press_pile_t
[tattlekey] / client / press.h
CommitLineData
2dcbb2a0
SW
1#ifndef SENDS_H
2#define SENDS_H
3
4#include "pico/cyw43_arch.h"
5#include "pico/util/pheap.h"
6
7typedef struct {
8 uint32_t timestamp;
9 u16_t seq;
10 u8_t send_count;
17461dec 11} press_t;
2dcbb2a0 12
e3ff9e0d
SW
13typedef struct {
14 press_t *presses;
15 pheap_t *sleeps_heap;
16} press_pile_t;
17
18press_pile_t *create_press_pile();
2dcbb2a0 19
e3ff9e0d 20void create_press(press_pile_t *pp, uint32_t timestamp, u16_t seq);
67001c93 21
b512ec26
SW
22/* When do we next need to send something (in seconds since boot)?
23 * Returns -1 if there's nothing pending. */
e3ff9e0d 24int32_t next_scheduled_send(press_pile_t *pp);
b512ec26 25
2dcbb2a0 26#endif