altos: Add support for multiple SPI busses and sharing device drivers
[fw/altos] / src / cc1111 / ao_radio.c
index 00816b33bdef4c9e784834c84c12d07a0ca3c6c9..ee506f896ce3bd606f5703f2b0a5a95b4c62ade8 100644 (file)
@@ -367,21 +367,9 @@ ao_radio_recv_abort(void)
 __xdata ao_radio_rdf_value = 0x55;
 
 void
-ao_radio_rdf(int ms)
+ao_radio_rdf(uint8_t pkt_len)
 {
        uint8_t i;
-       uint8_t pkt_len;
-
-       /*
-        * Compute the packet length as follows:
-        *
-        * 2000 bps (for a 1kHz tone)
-        * so, for 'ms' milliseconds, we need
-        * 2 * ms bits, or ms / 4 bytes
-        */
-       if (ms > (255 * 4))
-               ms = 255 * 4;
-       pkt_len = ms >> 2;
 
        ao_radio_abort = 0;
        ao_radio_get(pkt_len);
@@ -433,7 +421,7 @@ ao_radio_test(void)
        mode++;
        if ((mode & 2) && !radio_on) {
 #if HAS_MONITOR
-               ao_set_monitor(0);
+               ao_monitor_disable();
 #endif
 #if PACKET_HAS_SLAVE
                ao_packet_slave_stop();
@@ -451,6 +439,9 @@ ao_radio_test(void)
                ao_radio_idle();
                ao_radio_put();
                radio_on = 0;
+#if HAS_MONITOR
+               ao_monitor_enable();
+#endif
        }
 }