altos: Use new ao_spi_speed inline to set SPI speeds using spec'd frequencies
[fw/altos] / src / drivers / ao_cc115l.c
index c1c21e0d404e2a0259dd3b20ae23e5a0ad464c77..dc8e9ff315ad303df49ee0b1ccc151767e8c842e 100644 (file)
@@ -39,6 +39,8 @@ static uint8_t ao_radio_abort;                /* radio operation should abort */
 
 #define FOSC   26000000
 
+#define AO_CC115L_SPI_SPEED    ao_spi_speed(6500000)   /* for back-to-back access */
+
 #define ao_radio_select()      ao_spi_get_mask(AO_CC115L_SPI_CS_PORT,(1 << AO_CC115L_SPI_CS_PIN),AO_CC115L_SPI_BUS,AO_CC115L_SPI_SPEED)
 #define ao_radio_deselect()    ao_spi_put_mask(AO_CC115L_SPI_CS_PORT,(1 << AO_CC115L_SPI_CS_PIN),AO_CC115L_SPI_BUS)
 #define ao_radio_spi_send(d,l) ao_spi_send((d), (l), AO_CC115L_SPI_BUS)
@@ -596,7 +598,7 @@ uint8_t ao_radio_tone_count;
 uint8_t ao_radio_tone_current;
 uint8_t ao_radio_tone_offset;
 
-int16_t
+static int16_t
 ao_radio_tone_fill(uint8_t *buf, int16_t len)
 {
        int16_t ret = 0;
@@ -700,10 +702,8 @@ ao_radio_test_cmd(void)
        uint8_t mode = 2;
        static uint8_t radio_on;
        ao_cmd_white();
-       if (ao_cmd_lex_c != '\n') {
-               ao_cmd_decimal();
-               mode = (uint8_t) ao_cmd_lex_u32;
-       }
+       if (ao_cmd_lex_c != '\n')
+               mode = ao_cmd_decimal();
        mode++;
        if ((mode & 2) && !radio_on) {
 #if HAS_MONITOR