Substantially refactor ~everything to separate concerns and improve flow clarity

Highlights:
- Remove all use of malloc and friends
- Refactor message handling functions to work with references
- Move core message read => triage => respond logic loop to main
  function
- Improve message triage and support follow-up messages
- Refactor hex byte parsing
- Disable periodic interrupt when not playing
This commit is contained in:
Allen Hill
2026-05-08 12:59:42 -07:00
parent bdb1a8af0d
commit 4de22e01f3
7 changed files with 558 additions and 356 deletions
+18
View File
@@ -0,0 +1,18 @@
#pragma once
#include <stdint.h>
typedef struct Queue_struct {
uint8_t write;
uint8_t read;
uint8_t size;
void *buf[];
} Queue_t;
void constructQueue(Queue_t *q, void *buf, uint8_t size, uint8_t len,
uint8_t constructFull);
void constructEmptyQueue(Queue_t *q, uint8_t size, uint8_t len);
uint8_t isEmpty(const Queue_t *q);
uint8_t pushQueue(Queue_t *q, void *x);
const void *peekQueue(const Queue_t *q);
void *popQueue(Queue_t *q);