{
int8_t r;
AO_TICK_TYPE sent_time;
- AO_TICK_TYPE timeout = AO_MS_TO_TICKS(10);
+ AO_TICK_TYPE timeout = AO_MS_TO_TICKS(20);
#if HAS_RADIO_RATE
switch (ao_config.radio_rate) {
default:
break;
case AO_RADIO_RATE_9600:
- timeout = AO_MS_TO_TICKS(20);
+ timeout = AO_MS_TO_TICKS(30);
break;
case AO_RADIO_RATE_2400:
timeout = AO_MS_TO_TICKS(80);
}
#endif
ao_mutex_get(&ao_lco_mutex);
- command.tick = ao_time();
+ command.tick = (uint16_t) ao_time();
command.box = box;
command.cmd = AO_PAD_QUERY;
command.channels = 0;
sent_time = ao_time();
r = ao_radio_cmac_recv(query, sizeof (*query), timeout);
if (r == AO_RADIO_CMAC_OK)
- *tick_offset = sent_time - query->tick;
+ *tick_offset = (uint16_t) sent_time - query->tick;
ao_mutex_put(&ao_lco_mutex);
return r;
}