--- /dev/null
+/*
+ * 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;
+}
--- /dev/null
+/*
+ * 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; }
+}
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);
/*
* 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 )
{
}
#endif
- // TODO: handle this interrupt
- ASSERT( ! (irq & RF230_IRQ_PLL_UNLOCK) );
-
if( irq & RF230_IRQ_PLL_LOCK )
{
if( cmd == CMD_TURNON || cmd == CMD_CHANNEL )