]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
updated RF230layerP, added dummy LPL
authorsallai <sallai>
Sat, 17 Nov 2007 02:29:33 +0000 (02:29 +0000)
committersallai <sallai>
Sat, 17 Nov 2007 02:29:33 +0000 (02:29 +0000)
tos/chips/rf230/DummyLPLMacC.nc [new file with mode: 0644]
tos/chips/rf230/DummyLPLP.nc [new file with mode: 0644]
tos/chips/rf230/RF230LayerP.nc

diff --git a/tos/chips/rf230/DummyLPLMacC.nc b/tos/chips/rf230/DummyLPLMacC.nc
new file mode 100644 (file)
index 0000000..ae42f5e
--- /dev/null
@@ -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 (file)
index 0000000..7ee79b9
--- /dev/null
@@ -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; }
+}
index ef4c52f69f1b5613cfa54db6558d54360c069983..e1d329800a6e9032b582f19a4d37767dff4fe9c0 100644 (file)
@@ -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 )