atomic
{
call SLP_TR.set();
- time = call RadioAlarm.getNow() + TX_SFD_DELAY;
+ time = call RadioAlarm.getNow();
}
call SLP_TR.clr();
#endif
atomic
{
call SLP_TR.set();
- time = call RadioAlarm.getNow() + TX_SFD_DELAY;
+ time = call RadioAlarm.getNow();
}
call SLP_TR.clr();
#endif
- time32 += (int16_t)(time) - (int16_t)(time32);
+ time32 += (int16_t)(time + TX_SFD_DELAY) - (int16_t)(time32);
if( timesync != 0 )
*(timesync_relative_t*)timesync = (*(timesync_absolute_t*)timesync) - time32;
}
#endif
+#ifdef RF230_RSSI_ENERGY
+ if( irq & RF230_IRQ_TRX_END )
+ {
+ if( irq == RF230_IRQ_TRX_END ||
+ (irq == (RF230_IRQ_RX_START | RF230_IRQ_TRX_END) && cmd == CMD_NONE) )
+ call PacketRSSI.set(rxMsg, readRegister(RF230_PHY_ED_LEVEL));
+ else
+ call PacketRSSI.clear(rxMsg);
+ }
+#endif
+
if( irq & RF230_IRQ_PLL_LOCK )
{
if( cmd == CMD_TURNON || cmd == CMD_CHANNEL )
else if( cmd == CMD_RECEIVE )
{
ASSERT( state == STATE_RX_ON || state == STATE_PLL_ON_2_RX_ON );
-#ifdef RF230_RSSI_ENERGY
- if( irq == RF230_IRQ_TRX_END )
- call PacketRSSI.set(rxMsg, readRegister(RF230_PHY_ED_LEVEL));
- else
- call PacketRSSI.clear(rxMsg);
-#endif
+
if( state == STATE_PLL_ON_2_RX_ON )
{
ASSERT( (readRegister(RF230_TRX_STATUS) & RF230_TRX_STATUS_MASK) == RF230_PLL_ON );