[Tinyos-2-commits] [tinyos-main] r5948 committed - rf212: fix irq handling when going to sleep...

tinyos-main at googlecode.com tinyos-main at googlecode.com
Fri Apr 20 08:13:34 PDT 2012


Revision: 5948
Author:   mmaroti
Date:     Fri Apr 20 08:13:18 2012
Log:      rf212: fix irq handling when going to sleep

From: Reinhard Bischoff <reinhard.bischoff at decentlab.com>
http://code.google.com/p/tinyos-main/source/detail?r=5948

Modified:
  /trunk/tos/chips/rf212/RF212DriverLayerP.nc

=======================================
--- /trunk/tos/chips/rf212/RF212DriverLayerP.nc	Thu Mar  8 09:20:25 2012
+++ /trunk/tos/chips/rf212/RF212DriverLayerP.nc	Fri Apr 20 08:13:18 2012
@@ -360,8 +360,6 @@
  		if( (cmd == CMD_STANDBY || cmd == CMD_TURNON) && state == STATE_SLEEP &&  
isSpiAcquired())
  		{
  			RADIO_ASSERT( ! radioIrq );
-
-			readRegister(RF212_IRQ_STATUS); // clear the interrupt register
  			call IRQ.captureRisingEdge();
  			state = STATE_SLEEP_2_TRX_OFF;
  			call SLP_TR.clr();
@@ -379,14 +377,12 @@
  		{
  			call IRQ.disable();
  			writeRegister(RF212_TRX_STATE, RF212_FORCE_TRX_OFF);
-
-			radioIrq = FALSE;
-
  			state = STATE_TRX_OFF;
  		}

  		if( cmd == CMD_TURNOFF && state == STATE_TRX_OFF )
  		{
+			readRegister(RF212_IRQ_STATUS); // clear the interrupt register
  			call SLP_TR.set();
  			state = STATE_SLEEP;
  			cmd = CMD_SIGNAL_DONE;


More information about the Tinyos-2-commits mailing list