mirror of
https://github.com/halleysfifthinc/AVCLAN-Mockingboard.git
synced 2026-08-07 01:13:18 +00:00
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:
+18
@@ -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);
|
||||
Reference in New Issue
Block a user