altos/cc1200: Adjust bit-sync configuration
[fw/altos] / src / drivers / ao_cc1200.c
index 93bb2c6c4f752b5794585ea663235d1202cb1bf7..df4bd335a974ba3d6df76143f4faf9b67de14d58 100644 (file)
@@ -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;