From: mmaroti Date: Wed, 7 May 2008 21:33:13 +0000 (+0000) Subject: more LPL debugging X-Git-Tag: release_tinyos_2_1_0_0~420 X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;h=79547f031dd94d655523029033804b6c94716e77;p=tinyos-2.x.git more LPL debugging --- diff --git a/tos/chips/rf230/DefaultPacketP.nc b/tos/chips/rf230/DefaultPacketP.nc index e7d04423..99d632fd 100644 --- a/tos/chips/rf230/DefaultPacketP.nc +++ b/tos/chips/rf230/DefaultPacketP.nc @@ -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 -----------------*/ diff --git a/tos/chips/rf230/LowPowerListeningLayerP.nc b/tos/chips/rf230/LowPowerListeningLayerP.nc index fe33c478..d4b2ff79 100644 --- a/tos/chips/rf230/LowPowerListeningLayerP.nc +++ b/tos/chips/rf230/LowPowerListeningLayerP.nc @@ -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() diff --git a/tos/chips/rf230/RF230LayerP.nc b/tos/chips/rf230/RF230LayerP.nc index c9329698..9788d59a 100644 --- a/tos/chips/rf230/RF230LayerP.nc +++ b/tos/chips/rf230/RF230LayerP.nc @@ -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 + } } } }