[Tinyos-commits] CVS: tinyos-1.x/tos/platform/mica2
CC1000RadioIntM.nc, 1.29, 1.30
Phil Levis
scipio at users.sourceforge.net
Mon Aug 9 17:35:22 PDT 2004
Update of /cvsroot/tinyos/tinyos-1.x/tos/platform/mica2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27378
Modified Files:
CC1000RadioIntM.nc
Log Message:
Patch submitted by David Moore to fix a condition under which the
CC1000 stack hangs.
The issue is that SpiByteFifo.rxMode() and CC1000Control.RxMode()
are both called in the TXSTATE_DONE case, whether or
not the
post packetSent()
succeeds. The operations include calls to TOSH_uwait(), which make
this code path fairly long (!400 us). When the task queue overflows,
causing the post to fail, he next time an SPI interrupt is handled,
the same code path will execute. The problem is that the SPI interrupt
rate is high enough that these calls will essentially starve the task
queue from executing, so the task queue will never empty and the mote
will hang.
The fix is to make the calls
SpiByteFifo.rxMode();
CC1000Control.RxMode();
in the block that executes when the post succeeds. This means that the
mote cannot receive packets while the task queue is temporarily in
this overflowed state, but that seems like a perfectly reasonable
tradeoff to have, since you're still in TXSTATE_DONE anyways.
Index: CC1000RadioIntM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** CC1000RadioIntM.nc 26 Apr 2004 03:09:37 -0000 1.29
--- CC1000RadioIntM.nc 10 Aug 2004 00:35:19 -0000 1.30
***************
*** 705,714 ****
case TXSTATE_DONE:
default:
- call SpiByteFifo.rxMode();
- call CC1000Control.RxMode();
bTxPending = FALSE;
if (post PacketSent()) {
// If the post operation succeeds, goto Idle
// otherwise, we'll try again.
RadioState = IDLE_STATE;
RSSIInitState = RadioState;
--- 705,714 ----
case TXSTATE_DONE:
default:
bTxPending = FALSE;
if (post PacketSent()) {
// If the post operation succeeds, goto Idle
// otherwise, we'll try again.
+ call SpiByteFifo.rxMode();
+ call CC1000Control.RxMode();
RadioState = IDLE_STATE;
RSSIInitState = RadioState;
More information about the Tinyos-commits
mailing list