#include "crc.h"
#include "message.h"
-module CC2420TransmitP {
+module CC2420TransmitP @safe() {
provides interface Init;
provides interface StdControl;
// 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();
}
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;
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 );