[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/rf230 RF230LayerP.nc, 1.13, 1.14

Miklos Maroti mmaroti at users.sourceforge.net
Tue May 13 15:59:41 PDT 2008


Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv632

Modified Files:
	RF230LayerP.nc 
Log Message:
added RF230_RSSI_ENERGY config option to report ED instead of RSSI

Index: RF230LayerP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230/RF230LayerP.nc,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** RF230LayerP.nc	13 May 2008 19:48:00 -0000	1.13
--- RF230LayerP.nc	13 May 2008 22:59:37 -0000	1.14
***************
*** 396,400 ****
  
  		if( call RF230Config.requiresRssiCca(msg) 
! 				&& readRegister(RF230_PHY_RSSI) > ((rssiClear + rssiBusy) >> 3) )
  			return EBUSY;
  
--- 396,400 ----
  
  		if( call RF230Config.requiresRssiCca(msg) 
! 				&& (readRegister(RF230_PHY_RSSI) & RF230_RSSI_MASK) > ((rssiClear + rssiBusy) >> 3) )
  			return EBUSY;
  
***************
*** 678,687 ****
  					ASSERT( state == STATE_RX_ON || state == STATE_PLL_ON_2_RX_ON );
  
! 					// the most likely place for busy channel, with no TRX_END
  					if( irq == RF230_IRQ_RX_START )
  					{
! 						temp = readRegister(RF230_PHY_RSSI);
  
  						rssiBusy += temp - (rssiBusy >> 2);
  						call PacketRSSI.set(rxMsg, temp);
  					}
--- 678,692 ----
  					ASSERT( state == STATE_RX_ON || state == STATE_PLL_ON_2_RX_ON );
  
! 					// the most likely place for busy channel, with no TRX_END interrupt
  					if( irq == RF230_IRQ_RX_START )
  					{
! 						temp = readRegister(RF230_PHY_RSSI) & RF230_RSSI_MASK;
  
  						rssiBusy += temp - (rssiBusy >> 2);
+ 
+ #ifdef RF230_RSSI_ENERGY
+ 						temp = readRegister(RF230_PHY_ED_LEVEL);
+ #endif
+ 
  						call PacketRSSI.set(rxMsg, temp);
  					}
***************
*** 735,739 ****
  					{
  						// the most likely place for clear channel (hope to avoid acks)
! 						rssiClear += readRegister(RF230_PHY_RSSI) - (rssiClear >> 2);
  					}
  
--- 740,744 ----
  					{
  						// the most likely place for clear channel (hope to avoid acks)
! 						rssiClear += (readRegister(RF230_PHY_RSSI) & RF230_RSSI_MASK) - (rssiClear >> 2);
  					}
  



More information about the Tinyos-2-commits mailing list