cc2420: do not declare sfd_timestamp if not used

This commit is contained in:
Simon Duquennoy 2015-10-01 11:13:06 +02:00
parent 6594cd1bba
commit e5d5cf7018

View file

@ -655,17 +655,17 @@ cc2420_transmit(unsigned short payload_len)
#endif /* WITH_SEND_CCA */ #endif /* WITH_SEND_CCA */
for(i = LOOP_20_SYMBOLS; i > 0; i--) { for(i = LOOP_20_SYMBOLS; i > 0; i--) {
if(CC2420_SFD_IS_1) { if(CC2420_SFD_IS_1) {
#if PACKETBUF_WITH_PACKET_TYPE
{ {
rtimer_clock_t sfd_timestamp; rtimer_clock_t sfd_timestamp;
sfd_timestamp = cc2420_sfd_start_time; sfd_timestamp = cc2420_sfd_start_time;
#if PACKETBUF_WITH_PACKET_TYPE
if(packetbuf_attr(PACKETBUF_ATTR_PACKET_TYPE) == if(packetbuf_attr(PACKETBUF_ATTR_PACKET_TYPE) ==
PACKETBUF_ATTR_PACKET_TYPE_TIMESTAMP) { PACKETBUF_ATTR_PACKET_TYPE_TIMESTAMP) {
/* Write timestamp to last two bytes of packet in TXFIFO. */ /* Write timestamp to last two bytes of packet in TXFIFO. */
write_ram((uint8_t *) &sfd_timestamp, CC2420RAM_TXFIFO + payload_len - 1, 2, WRITE_RAM_IN_ORDER); write_ram((uint8_t *) &sfd_timestamp, CC2420RAM_TXFIFO + payload_len - 1, 2, WRITE_RAM_IN_ORDER);
} }
#endif
} }
#endif /* PACKETBUF_WITH_PACKET_TYPE */
if(!(get_status() & BV(CC2420_TX_ACTIVE))) { if(!(get_status() & BV(CC2420_TX_ACTIVE))) {
/* SFD went high but we are not transmitting. This means that /* SFD went high but we are not transmitting. This means that