From: idgay Date: Mon, 23 Jun 2008 22:44:27 +0000 (+0000) Subject: deputy-fixes X-Git-Tag: release_tinyos_2_1_0_0~198 X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;h=2f3b4d843e48cfe098d8b01159d756fddd6420b8;p=tinyos-2.x.git deputy-fixes --- diff --git a/tos/chips/atm128/adc/AdcStreamP.nc b/tos/chips/atm128/adc/AdcStreamP.nc index b5a844f4..4af74c3f 100644 --- a/tos/chips/atm128/adc/AdcStreamP.nc +++ b/tos/chips/atm128/adc/AdcStreamP.nc @@ -72,7 +72,7 @@ implementation { }; 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; @@ -208,6 +208,7 @@ implementation { 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); @@ -228,7 +229,7 @@ implementation { else { *pos++ = data; - if (!--count) + if (pos == buffer + count) { atomic { @@ -241,8 +242,8 @@ implementation { } else { + lastCount = count; lastBuffer = buffer; - lastCount = pos - buffer; } } post bufferDone();