mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-08-14 09:28:59 +00:00
Fix warnings in ContikiMAC
../..//core/net/mac/contikimac/contikimac.c:503:11: warning: variable ‘seqno’ set but not used [-Wunused-but-set-variable] ../..//core/net/mac/contikimac/contikimac.c:496:7: warning: variable ‘len’ set but not used [-Wunused-but-set-variable] Both of these variables are only used if RDC_CONF_HARDWARE_ACK is not true. Their definitions and use have been moved into #ifdef guards so they do not appear if RDC_CONF_HARDWARE_ACK is set.
This commit is contained in:
parent
ca50a2c6df
commit
8739113308
@ -493,14 +493,16 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
|
|||||||
#endif
|
#endif
|
||||||
int strobes;
|
int strobes;
|
||||||
uint8_t got_strobe_ack = 0;
|
uint8_t got_strobe_ack = 0;
|
||||||
int len;
|
|
||||||
uint8_t is_broadcast = 0;
|
uint8_t is_broadcast = 0;
|
||||||
uint8_t is_known_receiver = 0;
|
uint8_t is_known_receiver = 0;
|
||||||
uint8_t collisions;
|
uint8_t collisions;
|
||||||
int transmit_len;
|
int transmit_len;
|
||||||
int ret;
|
int ret;
|
||||||
uint8_t contikimac_was_on;
|
uint8_t contikimac_was_on;
|
||||||
|
#if !RDC_CONF_HARDWARE_ACK
|
||||||
|
int len;
|
||||||
uint8_t seqno;
|
uint8_t seqno;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Exit if RDC and radio were explicitly turned off */
|
/* Exit if RDC and radio were explicitly turned off */
|
||||||
if(!contikimac_is_on && !contikimac_keep_radio_on) {
|
if(!contikimac_is_on && !contikimac_keep_radio_on) {
|
||||||
@ -641,11 +643,11 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
|
|||||||
or rx cycle */
|
or rx cycle */
|
||||||
on();
|
on();
|
||||||
}
|
}
|
||||||
|
seqno = packetbuf_attr(PACKETBUF_ATTR_MAC_SEQNO);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
watchdog_periodic();
|
watchdog_periodic();
|
||||||
t0 = RTIMER_NOW();
|
t0 = RTIMER_NOW();
|
||||||
seqno = packetbuf_attr(PACKETBUF_ATTR_MAC_SEQNO);
|
|
||||||
for(strobes = 0, collisions = 0;
|
for(strobes = 0, collisions = 0;
|
||||||
got_strobe_ack == 0 && collisions == 0 &&
|
got_strobe_ack == 0 && collisions == 0 &&
|
||||||
RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + STROBE_TIME); strobes++) {
|
RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + STROBE_TIME); strobes++) {
|
||||||
@ -658,7 +660,9 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !RDC_CONF_HARDWARE_ACK
|
||||||
len = 0;
|
len = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
rtimer_clock_t wt;
|
rtimer_clock_t wt;
|
||||||
|
Loading…
Reference in New Issue
Block a user