Channel check interval is clock_time_t
Fix channel_check_interval routine in struct rdc_driver to be of type clock_time_t -- otherwise this may overflow on some architectures.
This commit is contained in:
parent
0232e6c9dc
commit
d7e6935ec2
|
@ -544,7 +544,9 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
|
|||
int strobes;
|
||||
uint8_t got_strobe_ack = 0;
|
||||
uint8_t is_broadcast = 0;
|
||||
#if WITH_PHASE_OPTIMIZATION
|
||||
uint8_t is_known_receiver = 0;
|
||||
#endif
|
||||
uint8_t collisions;
|
||||
int transmit_len;
|
||||
int ret;
|
||||
|
@ -1067,7 +1069,7 @@ turn_off(int keep_radio_on)
|
|||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static unsigned short
|
||||
static clock_time_t
|
||||
duty_cycle(void)
|
||||
{
|
||||
return (1ul * CLOCK_SECOND * CYCLE_TIME) / RTIMER_ARCH_SECOND;
|
||||
|
|
|
@ -918,7 +918,7 @@ turn_off(int keep_radio_on)
|
|||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static unsigned short
|
||||
static clock_time_t
|
||||
channel_check_interval(void)
|
||||
{
|
||||
return (1ul * CLOCK_SECOND * DEFAULT_PERIOD) / RTIMER_ARCH_SECOND;
|
||||
|
|
|
@ -70,7 +70,7 @@ off(int keep_radio_on)
|
|||
return 0;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static unsigned short
|
||||
static clock_time_t
|
||||
channel_check_interval(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -87,7 +87,7 @@ off(int keep_radio_on)
|
|||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static unsigned short
|
||||
static clock_time_t
|
||||
channel_check_interval(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -343,7 +343,7 @@ off(int keep_radio_on)
|
|||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static unsigned short
|
||||
static clock_time_t
|
||||
channel_check_interval(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -86,7 +86,7 @@ struct rdc_driver {
|
|||
int (* off)(int keep_radio_on);
|
||||
|
||||
/** Returns the channel check interval, expressed in clock_time_t ticks. */
|
||||
unsigned short (* channel_check_interval)(void);
|
||||
clock_time_t (* channel_check_interval)(void);
|
||||
};
|
||||
|
||||
#endif /* RDC_H_ */
|
||||
|
|
|
@ -251,7 +251,7 @@ init(void)
|
|||
NETSTACK_RADIO.on();
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static unsigned short
|
||||
static clock_time_t
|
||||
channel_check_interval(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -76,7 +76,7 @@ off(int keep_radio_on)
|
|||
return keep_radio_on;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static unsigned short
|
||||
static clock_time_t
|
||||
cca(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -72,7 +72,7 @@ off(int keep_radio_on)
|
|||
return keep_radio_on;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static unsigned short
|
||||
static clock_time_t
|
||||
cca(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -170,7 +170,7 @@ off(int keep_radio_on)
|
|||
return 1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static unsigned short
|
||||
static clock_time_t
|
||||
channel_check_interval(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -170,7 +170,7 @@ off(int keep_radio_on)
|
|||
return 1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static unsigned short
|
||||
static clock_time_t
|
||||
channel_check_interval(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue