X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdrivers%2Fao_cc1200.c;h=df4bd335a974ba3d6df76143f4faf9b67de14d58;hb=2614d20b324ab215ef22f178e3635d48e757fa9b;hp=93bb2c6c4f752b5794585ea663235d1202cb1bf7;hpb=eabeb76a2a9acb624ae364c4f0f315bfc3549d98;p=fw%2Faltos diff --git a/src/drivers/ao_cc1200.c b/src/drivers/ao_cc1200.c index 93bb2c6c..df4bd335 100644 --- a/src/drivers/ao_cc1200.c +++ b/src/drivers/ao_cc1200.c @@ -715,17 +715,11 @@ ao_radio_show_state(char *where) static void ao_radio_wait_isr(uint16_t timeout) { - if (timeout) - ao_alarm(timeout); - ao_arch_block_interrupts(); while (!ao_radio_wake && !ao_radio_abort) - if (ao_sleep(&ao_radio_wake)) + if (ao_sleep_for(&ao_radio_wake, timeout)) ao_radio_abort = 1; ao_arch_release_interrupts(); - - if (timeout) - ao_clear_alarm(); } static void @@ -1045,8 +1039,7 @@ ao_radio_recv(__xdata void *d, uint8_t size, uint8_t timeout) /* Check to see if the packet header has been seen, in which case we'll * want to keep waiting for the rest of the packet to appear */ - if (modem_status1 & ((1 << CC1200_MODEM_STATUS1_SYNC_FOUND) | - (1 << CC1200_MODEM_STATUS1_PQT_REACHED))) + if (modem_status1 & (1 << CC1200_MODEM_STATUS1_SYNC_FOUND)) { ao_radio_abort = 0;