2 functions for static FIFO implimentation.
10 void q_flush(queue_t
*q
) {
15 QUEUE_BASE_T
q_pop(queue_t
*q
) {
16 // take the last thing that was put on
21 QUEUE_BASE_T old
= q
->buffer
[q
->last
];
30 QUEUE_BASE_T
q_get(queue_t
*q
) {
33 fprintf(io_isr
,"\n{warn: pop}");
39 x
= q
->buffer
[ q
->first
];
41 if ( q
->first
>= q
->len
)
49 int8_t q_push(queue_t
*q
, QUEUE_BASE_T x
)
53 fprintf(io_isr
,"\n{warn: push (%d)}",x
);
58 q
->buffer
[ q
->last
] = x
;
60 if ( q
->last
>= q
->len
)
69 int8_t q_push_o(queue_t
*q
, QUEUE_BASE_T x
)
71 q
->buffer
[ q
->last
] = x
;
73 if ( q
->last
>= q
->len
)
81 bool q_empty(queue_t
*q
) {
82 if (q
->ct
<= 0) return true;
86 bool q_full(queue_t
*q
) {
87 if (q
->ct
>= q
->len
) return true;