]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
more LPL debugging
authormmaroti <mmaroti>
Wed, 7 May 2008 21:33:13 +0000 (21:33 +0000)
committermmaroti <mmaroti>
Wed, 7 May 2008 21:33:13 +0000 (21:33 +0000)
tos/chips/rf230/DefaultPacketP.nc
tos/chips/rf230/LowPowerListeningLayerP.nc
tos/chips/rf230/RF230LayerP.nc

index e7d0442371c94a7ee9ab17a200b31a21631e62de..99d632fd86a281b010077457cf07ff5f3ab3937a 100644 (file)
@@ -164,15 +164,17 @@ implementation
 
 /*----------------- Global fields -----------------*/
 
-       uint8_t flags;
+       norace uint8_t flags;
        enum
        {
                FLAG_TXPOWER = 0x01,
                FLAG_SLEEPINT = 0x02,
        };
 
-       uint8_t transmitPower;
-       uint16_t sleepInterval;
+       norace uint8_t transmitPower;
+
+       // TODO: Move sleepInterval into the metadata
+       norace uint16_t sleepInterval;
 
 /*----------------- PacketTransmitPower -----------------*/
 
index fe33c4783d1e450e3d8fae0f9b519b78af87c665..d4b2ff79836ddf0dc91df659e6793c8082a20474 100644 (file)
@@ -267,16 +267,6 @@ implementation
                post transition();
        }
 
-       void sleepIntervalChanged()
-       {
-               if( (state == LISTEN && sleepInterval == 0) || state == SLEEP )
-               {
-                       call Timer.stop();
-                       --state;
-                       post transition();
-               }
-       }
-
        event message_t* SubReceive.receive(message_t* msg, void* payload, uint8_t len)
        {
                if( state == SLEEP_SUBSTOP )
@@ -389,7 +379,13 @@ implementation
                        interval = MAX_SLEEP;
 
                sleepInterval = interval;
-               sleepIntervalChanged();
+
+               if( (state == LISTEN && sleepInterval == 0) || state == SLEEP )
+               {
+                       call Timer.stop();
+                       --state;
+                       post transition();
+               }
        }
 
        command uint16_t LowPowerListening.getLocalSleepInterval()
index c9329698fd4f3cae32edb5967f9eda2024718349..9788d59aff36d081801f0de554aeeed4fb8afff5 100644 (file)
@@ -658,7 +658,22 @@ implementation
                                        ASSERT( state == STATE_BUSY_TX_2_RX_ON );
                                }
                                else
-                                       ASSERT(FALSE);
+                               {
+#ifdef RF230_DEBUG
+//                                     ASSERT(FALSE);
+                                       if( call DiagMsg.record() )
+                                       {
+                                               call DiagMsg.str("assert pll");
+                                               call DiagMsg.uint16(call RadioAlarm.getNow());
+                                               call DiagMsg.hex8(readRegister(RF230_TRX_STATUS));
+                                               call DiagMsg.hex8(readRegister(RF230_TRX_STATE));
+                                               call DiagMsg.hex8(irq);
+                                               call DiagMsg.uint8(state);
+                                               call DiagMsg.uint8(cmd);
+                                               call DiagMsg.send();
+                                       }
+#endif
+                               }
                        }
 
                        if( irq & RF230_IRQ_RX_START )
@@ -742,7 +757,22 @@ implementation
                                        cmd = CMD_DOWNLOAD;
                                }
                                else
-                                       ASSERT(FALSE);
+                               {
+#ifdef RF230_DEBUG
+//                                     ASSERT(FALSE);
+                                       if( call DiagMsg.record() )
+                                       {
+                                               call DiagMsg.str("assert trx");
+                                               call DiagMsg.uint16(call RadioAlarm.getNow());
+                                               call DiagMsg.hex8(readRegister(RF230_TRX_STATUS));
+                                               call DiagMsg.hex8(readRegister(RF230_TRX_STATE));
+                                               call DiagMsg.hex8(irq);
+                                               call DiagMsg.uint8(state);
+                                               call DiagMsg.uint8(cmd);
+                                               call DiagMsg.send();
+                                       }
+#endif
+                               }
                        }
                }
        }