This commit is contained in:
2025-11-25 19:47:32 -08:00
parent c0d157e72a
commit ebb25ba911
1016 changed files with 446700 additions and 12362 deletions

View File

@@ -0,0 +1,33 @@
#ifndef HID_QUEUE_H
#define HID_QUEUE_H
#include <stdint.h>
#include <stdbool.h>
typedef struct {
uint8_t MODIFIER; // Modifier keys (Ctrl, Shift, Alt, Win)
uint8_t RESERVED; // Always 0
uint8_t KEYPRESS[12]; // Up to 12 keycodes
} __attribute__((packed)) HIDReport;
typedef struct {
HIDReport *buffer;
uint16_t capacity;
uint16_t head;
uint16_t tail;
uint16_t count;
} HIDQueue;
// Init + reset
bool hid_queue_init(HIDQueue *q, HIDReport *buffer, uint16_t capacity);
void hid_queue_reset(HIDQueue *q);
// FIFO Ops
bool hid_queue_push(HIDQueue *q, HIDReport item);
bool hid_queue_pop(HIDQueue *q, HIDReport *out);
// Helpers
bool hid_queue_is_empty(HIDQueue *q);
bool hid_queue_is_full(HIDQueue *q);
#endif