[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/rf230 DummyLPLMacC.nc, NONE, 1.1 DummyLPLP.nc, NONE, 1.1 RF230LayerP.nc, 1.1, 1.2

Janos Sallai sallai at users.sourceforge.net
Fri Nov 16 18:29:35 PST 2007


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

Modified Files:
	RF230LayerP.nc 
Added Files:
	DummyLPLMacC.nc DummyLPLP.nc 
Log Message:
updated RF230layerP, added dummy LPL

--- NEW FILE: DummyLPLMacC.nc ---
/*
 * Copyright (c) 2007, Vanderbilt University
 * All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose, without fee, and without written agreement is
 * hereby granted, provided that the above copyright notice, the following
 * two paragraphs and the author appear in all copies of this software.
 * 
 * IN NO EVENT SHALL THE VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE VANDERBILT
 * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 * THE VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Author: Janos Sallai
 */

/* This component adds a dummy Low Power Listening support to the default rf230
 * MAC. The functions of the LowPowerListening interface do nothing. */
configuration DummyLPLMacC
{
	provides 
	{
		interface SplitControl;

		interface AMSend[am_id_t id];
		interface Receive[am_id_t id];
		interface Receive as Snoop[am_id_t id];

		interface Packet;
		interface AMPacket;
		interface PacketAcknowledgements;
		interface LowPowerListening;
	}
}

implementation
{
	components DefaultMacC, DummyLPLP;

	SplitControl = DefaultMacC;
	AMSend = DefaultMacC;
	Receive = DefaultMacC.Receive;
	Snoop = DefaultMacC.Snoop;
	Packet = DefaultMacC;
	AMPacket = DefaultMacC;
	PacketAcknowledgements = DefaultMacC;
	LowPowerListening = DummyLPLP;
}

--- NEW FILE: DummyLPLP.nc ---
/*
 * Copyright (c) 2007, Vanderbilt University
 * All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose, without fee, and without written agreement is
 * hereby granted, provided that the above copyright notice, the following
 * two paragraphs and the author appear in all copies of this software.
 * 
 * IN NO EVENT SHALL THE VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE VANDERBILT
 * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 * THE VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Author: Janos Sallai
 */

module DummyLPLP {
  provides interface LowPowerListening as LPL;
}
implementation {
  command void LPL.setLocalSleepInterval(uint16_t sleepIntervalMs)
    {}
  command uint16_t LPL.getLocalSleepInterval()
    { return 0; }
  command void LPL.setLocalDutyCycle(uint16_t dutyCycle) {}
  command uint16_t LPL.getLocalDutyCycle()
    { return 10000; }
  command void LPL.setRxSleepInterval(message_t *msg, uint16_t sleepIntervalMs)
    {}
  command uint16_t LPL.getRxSleepInterval(message_t *msg)
    { return 0; }
  command void LPL.setRxDutyCycle(message_t *msg, uint16_t dutyCycle)
    {}
  command uint16_t LPL.getRxDutyCycle(message_t *msg)
    { return 10000; }
  command uint16_t LPL.dutyCycleToSleepInterval(uint16_t dutyCycle)
    { return 0; }
  command uint16_t LPL.sleepIntervalToDutyCycle(uint16_t sleepInterval)
    { return 10000; }
}

Index: RF230LayerP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230/RF230LayerP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RF230LayerP.nc	5 Nov 2007 20:36:55 -0000	1.1
--- RF230LayerP.nc	17 Nov 2007 02:29:33 -0000	1.2
***************
*** 216,220 ****
  		call BusyWait.wait(510);
  
! 		writeRegister(RF230_IRQ_MASK, RF230_IRQ_TRX_UR | RF230_IRQ_PLL_UNLOCK | RF230_IRQ_PLL_LOCK | RF230_IRQ_TRX_END | RF230_IRQ_RX_START);
  		writeRegister(RF230_CCA_THRES, RF230_CCA_THRES_VALUE);
  		writeRegister(RF230_PHY_TX_PWR, RF230_TX_AUTO_CRC_ON | RF230_TX_PWR_DEFAULT);
--- 216,220 ----
  		call BusyWait.wait(510);
  
! 		writeRegister(RF230_IRQ_MASK, RF230_IRQ_TRX_UR | RF230_IRQ_PLL_LOCK | RF230_IRQ_TRX_END | RF230_IRQ_RX_START);
  		writeRegister(RF230_CCA_THRES, RF230_CCA_THRES_VALUE);
  		writeRegister(RF230_PHY_TX_PWR, RF230_TX_AUTO_CRC_ON | RF230_TX_PWR_DEFAULT);
***************
*** 444,448 ****
  		 * There is a very small window (~1 microsecond) when the RF230 went 
  		 * into PLL_ON state but was somehow not properly initialized because 
! 		 * of an incoming message and could not go into BUSY_TX. 
  		 */
  		if( (length & RF230_TRX_STATUS_MASK) != RF230_BUSY_TX )
--- 444,451 ----
  		 * There is a very small window (~1 microsecond) when the RF230 went 
  		 * into PLL_ON state but was somehow not properly initialized because 
! 		 * of an incoming message and could not go into BUSY_TX. I think the
! 		 * radio can even receive a message, and generate a TRX_UR interrupt
! 		 * because of concurrent access, but that message probably cannot be
! 		 * recovered.
  		 */
  		if( (length & RF230_TRX_STATUS_MASK) != RF230_BUSY_TX )
***************
*** 605,611 ****
  #endif
  
- 			// TODO: handle this interrupt
- 			ASSERT( ! (irq & RF230_IRQ_PLL_UNLOCK) );
- 
  			if( irq & RF230_IRQ_PLL_LOCK )
  			{
--- 608,611 ----



More information about the Tinyos-2-commits mailing list