-void create_press(press_t *presses, pheap_t *sleeps_heap, uint32_t timestamp,
- u16_t seq) {
- pheap_node_id_t i = ph_new_node(sleeps_heap);
+press_pile_t *create_press_pile() {
+ press_pile_t *pp = (press_pile_t *)malloc(sizeof(press_pile_t));
+ if (pp == NULL)
+ signal_error_by_blinking();
+ pp->presses = calloc(PICO_PHEAP_MAX_ENTRIES, sizeof(press_t));
+ if (pp->presses == NULL)
+ signal_error_by_blinking();
+ pp->sleeps_heap =
+ ph_create(PICO_PHEAP_MAX_ENTRIES, next_send_less_than, pp->presses);
+ if (pp->sleeps_heap == NULL)
+ signal_error_by_blinking();
+ return pp;
+}
+
+void create_press(press_pile_t *pp, uint32_t timestamp, u16_t seq) {
+ pheap_node_id_t i = ph_new_node(pp->sleeps_heap);