Fixed compiler warning (compiled with IAR)

This commit is contained in:
skarg
2010-09-07 16:17:25 +00:00
parent 4105d22b4b
commit e2314f0f5e
+9 -1
View File
@@ -52,7 +52,15 @@
unsigned FIFO_Count(
FIFO_BUFFER const *b)
{
return (b ? (b->head - b->tail) : 0);
unsigned head, tail; /* used to avoid volatile decision */
if (b) {
head = b->head;
tail = b->tail;
return head-tail;
} else {
return 0;
}
}
/****************************************************************************