I was thinking that this might need to be done to separate the head from tail in case head is incremented by ISR while this is called.

This commit is contained in:
skarg
2012-01-09 23:16:53 +00:00
parent bf4cd368b0
commit 1006b642e7
+4 -1
View File
@@ -194,8 +194,11 @@ bool FIFO_Add(
void FIFO_Flush(
FIFO_BUFFER * b)
{
unsigned head; /* used to avoid volatile decision */
if (b) {
b->tail = b->head;
head = b->head;
b->tail = head;
}
}