Sometimes the radio will give a spurious wakeup indicating that a
preamble seems to have arrived, but no packet data will appear. In
this case, abandon the packet reception and go back to waiting for a
preamble again. This releases the SPI bus for other users and also
avoids missing packets.
Signed-off-by: Keith Packard <keithp@keithp.com>
do {
if (ao_radio_mcu_wake)
ao_radio_check_marc_status();
+ ao_alarm(AO_MS_TO_TICKS(100));
ao_arch_block_interrupts();
rx_waiting = 1;
while (rx_data_cur - rx_data_consumed < AO_FEC_DECODE_BLOCK &&
}
rx_waiting = 0;
ao_arch_release_interrupts();
+ ao_clear_alarm();
} while (ao_radio_mcu_wake);
if (ao_radio_abort)
return 0;