]> git.scottworley.com Git - tattlekey/blobdiff - client/press.h
README: Fix image path for display in gitweb
[tattlekey] / client / press.h
index 69789e0984100a522f79f456ac1122a40d56c7aa..cd0f81d5a04f8eaaaae9cae052976dc6807b69ff 100644 (file)
@@ -1,8 +1,26 @@
+/* tattlekey: A one-key UDP keyboard
+ * Copyright (C) 2023  Scott Worley <scottworley@scottworley.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
 #ifndef SENDS_H
 #define SENDS_H
 
 #include "pico/cyw43_arch.h"
 #include "pico/util/pheap.h"
+#include "pico/util/queue.h"
 
 typedef struct {
   uint32_t timestamp;
@@ -11,8 +29,17 @@ typedef struct {
 } press_t;
 
 typedef struct {
-  press_t *presses;
+  /* Queues of various sizes that hold presses.  There is one queue for each
+   * send_count. */
+  queue_t *presses;
+
+  /* Tracks when each queue will be next ready-to-send.  Empty queues are not in
+   * the heap. */
   pheap_t *sleeps_heap;
+
+  /* The companion-array for the heap. */
+  queue_t **sleeps;
+
 } press_pile_t;
 
 press_pile_t *create_press_pile();