]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
add LPL tests and remove bad TX check from RF230LayerP
authormmaroti <mmaroti>
Thu, 8 May 2008 21:31:13 +0000 (21:31 +0000)
committermmaroti <mmaroti>
Thu, 8 May 2008 21:31:13 +0000 (21:31 +0000)
apps/tests/rf230/RadioCountToDiag/RadioCountToDiagC.nc
apps/tests/rf230/RadioCountToDiag/RadioCountToDiagP.nc
tos/chips/rf230/RF230LayerP.nc

index 0cbeb3dbbf94d2d40ca37442cdd9a4e7e4377122..4cb5b6e4f0db07b59f094c723e625c240bb83e46 100644 (file)
@@ -48,4 +48,6 @@ implementation
 
        components ActiveMessageAddressC;
        RadioCountToDiagP.ActiveMessageAddress -> ActiveMessageAddressC;
+
+       RadioCountToDiagP.LowPowerListening -> ActiveMessageC;
 }
index ad9de621568c4a86a749a743e13f53aa6a3e7882..e464cebd4bcc9aa7be69a8c140c1e2c743ba1a2e 100644 (file)
@@ -41,6 +41,7 @@ module RadioCountToDiagP
                interface SplitControl as RadioControl;
 
                interface ActiveMessageAddress;
+               interface LowPowerListening;
        }
 }
 
@@ -48,6 +49,10 @@ module RadioCountToDiagP
 #define SEND_PERIOD 10
 #endif
 
+#ifndef SLEEP_INTERVAL
+#define SLEEP_INTERVAL 50
+#endif
+
 implementation
 {
        task void radioPowerUp()
@@ -62,6 +67,9 @@ implementation
                        post radioPowerUp();
                else
                {
+#ifdef LOW_POWER_LISTENING
+                       call LowPowerListening.setLocalSleepInterval(SLEEP_INTERVAL);
+#endif         
                        call SendTimer.startPeriodic(SEND_PERIOD);
                        call ReportTimer.startPeriodic(1000);
                }
@@ -99,7 +107,6 @@ implementation
        }
 
        uint32_t sendCount;
-       uint32_t sendError;
        uint32_t sendDoneSuccess;
        uint32_t sendDoneError;
        uint32_t ackedCount;
@@ -112,7 +119,6 @@ implementation
                if( call DiagMsg.record() )
                {
                        call DiagMsg.uint16(sendCount);
-                       call DiagMsg.uint16(sendError);
                        call DiagMsg.uint16(sendDoneSuccess);
                        call DiagMsg.uint16(sendDoneError);
                        call DiagMsg.uint16(ackedCount);
@@ -137,6 +143,9 @@ implementation
 
                call Packet.clear(&txMsg);
                call PacketAcknowledgements.requestAck(&txMsg);
+#ifdef LOW_POWER_LISTENING
+               call LowPowerListening.setRxSleepInterval(&txMsg, SLEEP_INTERVAL);
+#endif
 
                addr = call ActiveMessageAddress.amAddress();
                if( addr == 2 )
@@ -148,8 +157,6 @@ implementation
 
                if( call AMSend.send(addr, &txMsg, sizeof(ping_t)) == SUCCESS )
                        ++sendCount;
-               else
-                       ++sendError;
        }
 
        event void AMSend.sendDone(message_t* msg, error_t error)
index 42d0401bc7748ba6c39435c9e6eb7df8fabd9856..b35705ab62ba93fc7a83963aa3d67ee23c1282af 100644 (file)
@@ -469,19 +469,10 @@ implementation
                 * radio can even receive a message, and generate a TRX_UR interrupt
                 * because of concurrent access, but that message probably cannot be
                 * recovered.
+                *
+                * TODO: this needs to be verified, and make sure that the chip is 
+                * not locked up in this case.
                 */
-               if( (readRegister(RF230_TRX_STATUS) & RF230_TRX_STATUS_MASK) != RF230_BUSY_TX )
-               {
-                       ASSERT( (readRegister(RF230_TRX_STATUS) & RF230_TRX_STATUS_MASK) == RF230_PLL_ON );
-
-                       writeRegister(RF230_TRX_STATE, RF230_RX_ON);
-                       readRegister(RF230_IRQ_STATUS);
-                       radioIrq = FALSE;
-
-                       call PacketTimeStamp.clear(msg);
-
-                       return FAIL;
-               }
 
                // go back to RX_ON state when finished
                writeRegister(RF230_TRX_STATE, RF230_RX_ON);