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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user