mirror of
https://github.com/halleysfifthinc/AVCLAN-Mockingboard.git
synced 2026-08-07 01:13:18 +00:00
Fix incorrect definition/initialization of caches
This commit is contained in:
+8
-7
@@ -4,24 +4,25 @@
|
||||
#include "avclandrv.h"
|
||||
#include "queue.h"
|
||||
|
||||
void constructQueue(Queue_t *q, void *buf, uint8_t size, uint8_t len,
|
||||
uint8_t constructFull) {
|
||||
void constructQueue(Queue_t *q, void **slots, void *items, uint8_t itemSize,
|
||||
uint8_t len, uint8_t constructFull) {
|
||||
q->read = 0;
|
||||
q->size = len;
|
||||
q->buf = slots;
|
||||
if (!!constructFull) {
|
||||
q->write = len;
|
||||
|
||||
for (uint8_t i = 0; i < len; ++i) {
|
||||
q->buf[i] = buf;
|
||||
buf = (char *)buf + size;
|
||||
q->buf[i] = items;
|
||||
items = (char *)items + itemSize;
|
||||
}
|
||||
} else {
|
||||
q->write = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void constructEmptyQueue(Queue_t *q, uint8_t size, uint8_t len) {
|
||||
constructQueue(q, NULL, size, len, 0);
|
||||
void constructEmptyQueue(Queue_t *q, void **slots, uint8_t len) {
|
||||
constructQueue(q, slots, NULL, 0, len, 0);
|
||||
}
|
||||
|
||||
uint8_t isEmpty(const Queue_t *q) { return (q->write == q->read); }
|
||||
@@ -43,7 +44,7 @@ uint8_t pushQueue(Queue_t *q, void *x) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const void *peekQueue(const Queue_t *q) {
|
||||
void *peekQueue(const Queue_t *q) {
|
||||
if (isEmpty(q))
|
||||
return NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user