X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Fcc2420%2Ftransmit%2FCC2420TransmitP.nc;h=5e45f8d769ae85f345f5db511eeba0c7b12f65a3;hb=31bef23ef3377514af595000d2fa2cce07bd4531;hp=a571fc70d6d955d1812958bfb7ebe862f21dca6b;hpb=4b9eec3a027f065b229df69e77d8ff2189b386d0;p=tinyos-2.x.git diff --git a/tos/chips/cc2420/transmit/CC2420TransmitP.nc b/tos/chips/cc2420/transmit/CC2420TransmitP.nc index a571fc70..5e45f8d7 100644 --- a/tos/chips/cc2420/transmit/CC2420TransmitP.nc +++ b/tos/chips/cc2420/transmit/CC2420TransmitP.nc @@ -236,12 +236,10 @@ implementation { } - inline uint32_t time16to32(uint16_t time, uint32_t recent_time) + inline uint32_t getTime32(uint16_t time) { - if ((recent_time&0xFFFF)fcf >> IEEE154_FCF_FRAME_TYPE ) & 7 ) == IEEE154_TYPE_DATA ) { - call PacketTimeStamp.set(m_msg, time32); - } - if ( call SFD.get() ) { break; } /** Fall Through because the next interrupt was already received */ - + case S_EFD: sfdHigh = FALSE; call CaptureSFD.captureRisingEdge(); @@ -310,7 +305,7 @@ implementation { /** Fall Through because the next interrupt was already received */ default: - if ( !m_receiving ) { + if ( !m_receiving && sfdHigh == FALSE ) { sfdHigh = TRUE; call CaptureSFD.captureFallingEdge(); call CC2420Receive.sfd( time32 ); @@ -322,16 +317,17 @@ implementation { } } - sfdHigh = FALSE; - call CaptureSFD.captureRisingEdge(); - m_receiving = FALSE; - if ( time - m_prev_time < 10 ) { - call CC2420Receive.sfd_dropped(); - if (m_msg) - call PacketTimeStamp.clear(m_msg); + if ( sfdHigh == TRUE ) { + sfdHigh = FALSE; + call CaptureSFD.captureRisingEdge(); + m_receiving = FALSE; + if ( time - m_prev_time < 10 ) { + call CC2420Receive.sfd_dropped(); + if (m_msg) + call PacketTimeStamp.clear(m_msg); + } + break; } - break; - } } }