X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Fcc2420%2Ftransmit%2FCC2420TransmitP.nc;h=bbf76f09f7f41464b70c0dcb09acf34596ea5f4d;hb=df004818be0944a5459b2d23dd4b49c55b716448;hp=1b6cd48f5e0b5dd0b816d2db0c192e17c262fd2d;hpb=6d640d119fc0dbe575698cb91c60dc4e2ff1fc9d;p=tinyos-2.x.git diff --git a/tos/chips/cc2420/transmit/CC2420TransmitP.nc b/tos/chips/cc2420/transmit/CC2420TransmitP.nc index 1b6cd48f..bbf76f09 100644 --- a/tos/chips/cc2420/transmit/CC2420TransmitP.nc +++ b/tos/chips/cc2420/transmit/CC2420TransmitP.nc @@ -268,12 +268,12 @@ implementation { call CaptureSFD.captureFallingEdge(); call PacketTimeStamp.set(m_msg, time32); if (call PacketTimeSyncOffset.isSet(m_msg)) { - nx_uint8_t *taddr = m_msg->data + (call PacketTimeSyncOffset.get(m_msg) - sizeof(cc2420_header_t)); - timesync_radio_t *timesync = (timesync_radio_t*)taddr; + uint8_t absOffset = sizeof(message_header_t)-sizeof(cc2420_header_t)+call PacketTimeSyncOffset.get(m_msg); + timesync_radio_t *timesync = (timesync_radio_t *)((nx_uint8_t*)m_msg+absOffset); // set timesync event time as the offset between the event time and the SFD interrupt time (TEP 133) *timesync -= time32; call CSN.clr(); - call TXFIFO_RAM.write( call PacketTimeSyncOffset.get(m_msg), (uint8_t*)timesync, sizeof(timesync_radio_t) ); + call TXFIFO_RAM.write( absOffset, (uint8_t*)timesync, sizeof(timesync_radio_t) ); call CSN.set(); }