From: sallai Date: Sat, 17 Nov 2007 02:29:33 +0000 (+0000) Subject: updated RF230layerP, added dummy LPL X-Git-Tag: release_tinyos_2_1_0_0~659 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=67cebf25720a8aabec9aaa1bb335a3bf05169f2e updated RF230layerP, added dummy LPL --- diff --git a/tos/chips/rf230/DummyLPLMacC.nc b/tos/chips/rf230/DummyLPLMacC.nc new file mode 100644 index 00000000..ae42f5ec --- /dev/null +++ b/tos/chips/rf230/DummyLPLMacC.nc @@ -0,0 +1,55 @@ +/* + * 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; +} diff --git a/tos/chips/rf230/DummyLPLP.nc b/tos/chips/rf230/DummyLPLP.nc new file mode 100644 index 00000000..7ee79b99 --- /dev/null +++ b/tos/chips/rf230/DummyLPLP.nc @@ -0,0 +1,47 @@ +/* + * 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; } +} diff --git a/tos/chips/rf230/RF230LayerP.nc b/tos/chips/rf230/RF230LayerP.nc index ef4c52f6..e1d32980 100644 --- a/tos/chips/rf230/RF230LayerP.nc +++ b/tos/chips/rf230/RF230LayerP.nc @@ -215,7 +215,7 @@ implementation 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_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); @@ -443,7 +443,10 @@ implementation /* * 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. + * 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 ) { @@ -604,9 +607,6 @@ implementation } #endif - // TODO: handle this interrupt - ASSERT( ! (irq & RF230_IRQ_PLL_UNLOCK) ); - if( irq & RF230_IRQ_PLL_LOCK ) { if( cmd == CMD_TURNON || cmd == CMD_CHANNEL )