]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/cc2420/transmit/CC2420TransmitP.nc
Fix pointer cast to uint8_t*.
[tinyos-2.x.git] / tos / chips / cc2420 / transmit / CC2420TransmitP.nc
index 17653d6584c4b471d366a52e2c06ef6b999dbf48..49aa130ea3e31fc2a00afec3bbfdda20eff18a6b 100644 (file)
@@ -41,7 +41,7 @@
 #include "crc.h"
 #include "message.h"
 
-module CC2420TransmitP {
+module CC2420TransmitP @safe() {
 
   provides interface Init;
   provides interface StdControl;
@@ -272,7 +272,7 @@ implementation {
            // 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), (void*)timesync, sizeof(timesync_radio_t) );
+           call TXFIFO_RAM.write( call PacketTimeSyncOffset.get(m_msg), (uint8_t*)timesync, sizeof(timesync_radio_t) );
            call CSN.set();
         }
 
@@ -327,7 +327,8 @@ implementation {
         m_receiving = FALSE;
         if ( time - m_prev_time < 10 ) {
           call CC2420Receive.sfd_dropped();
-          call PacketTimeStamp.clear(m_msg);
+         if (m_msg)
+           call PacketTimeStamp.clear(m_msg);
         }
         break;
       
@@ -355,7 +356,7 @@ implementation {
     uint8_t* ack_buf;
     uint8_t length;
 
-    if ( type == IEEE154_TYPE_ACK ) {
+    if ( type == IEEE154_TYPE_ACK && m_msg) {
       ack_header = call CC2420PacketBody.getHeader( ack_msg );
       msg_header = call CC2420PacketBody.getHeader( m_msg );