};
struct list_entry_t *bufferQueue[NSTREAM];
struct list_entry_t * ONE_NOK * bufferQueueEnd[NSTREAM];
- uint16_t * ONE_NOK lastBuffer, lastCount;
+ uint16_t * COUNT_NOK(lastCount) lastBuffer, lastCount;
norace uint16_t count;
norace uint16_t * COUNT_NOK(count) buffer;
bufferQueue[client] = entry->next;
if (!bufferQueue[client])
bufferQueueEnd[client] = &bufferQueue[client];
+ pos = buffer = NULL;
count = entry->count;
tmp_count = count;
pos = buffer = TCAST(uint16_t * COUNT_NOK(tmp_count), entry);
else
{
*pos++ = data;
- if (!--count)
+ if (pos == buffer + count)
{
atomic
{
}
else
{
+ lastCount = count;
lastBuffer = buffer;
- lastCount = pos - buffer;
}
}
post bufferDone();