altos: Make cc1111 radio control functions static
[fw/altos] / src / cc1111 / ao_radio.c
index 00816b33bdef4c9e784834c84c12d07a0ca3c6c9..2c4a661ec7883755b3448b0c709d10d8f5ea0dde 100644 (file)
@@ -260,7 +260,7 @@ ao_radio_general_isr(void) __interrupt 16
        }
 }
 
-void
+static void
 ao_radio_set_packet(void)
 {
        uint8_t i;
@@ -268,7 +268,7 @@ ao_radio_set_packet(void)
                RF[fixed_pkt_setup[i]] = fixed_pkt_setup[i+1];
 }
 
-void
+static void
 ao_radio_idle(void)
 {
        if (RF_MARCSTATE != RF_MARCSTATE_IDLE)
@@ -280,13 +280,15 @@ ao_radio_idle(void)
        }
 }
 
-void
+#define ao_radio_put() ao_mutex_put(&ao_radio_mutex)
+
+static void
 ao_radio_get(uint8_t len)
 {
        ao_config_get();
        ao_mutex_get(&ao_radio_mutex);
        ao_radio_idle();
-       RF_CHANNR = ao_config.radio_channel;
+       RF_CHANNR = 0;
        RF_FREQ2 = (uint8_t) (ao_config.radio_setting >> 16);
        RF_FREQ1 = (uint8_t) (ao_config.radio_setting >> 8);
        RF_FREQ0 = (uint8_t) (ao_config.radio_setting);
@@ -367,21 +369,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 +423,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 +441,9 @@ ao_radio_test(void)
                ao_radio_idle();
                ao_radio_put();
                radio_on = 0;
+#if HAS_MONITOR
+               ao_monitor_enable();
+#endif
        }
 }