altos: Set APRS deviation to 3kHz
[fw/altos] / src / drivers / ao_cc1120.c
index b6b77a5a5249628a1f14773f747d93ec5fab70d0..772014ee175f0087be15537b91f81e7ef15c1348 100644 (file)
@@ -392,16 +392,15 @@ static const uint16_t rdf_setup[] = {
 };
 
 /*
- * APRS deviation is 5kHz
+ * APRS deviation is 3kHz
  *
  *     fdev = fosc >> 24 * (256 + dev_m) << dev_e
  *
- *             32e6Hz / (2 ** 24) * (256 + 71) * (2 ** 3) = 4989
+ *             32e6Hz / (2 ** 24) * (256 + 137) * (2 ** 2) = 2998Hz
  */
 
-#define APRS_DEV_E     3
-#define APRS_DEV_M     71
-#define APRS_PACKET_LEN        50
+#define APRS_DEV_E     2
+#define APRS_DEV_M     137
 
 /*
  * For our APRS beacon, set the symbol rate to 9.6kBaud (8x oversampling for 1200 baud data rate)
@@ -964,8 +963,10 @@ ao_radio_recv(__xdata void *d, uint8_t size, uint8_t timeout)
 
        /* Wait for the preamble to appear */
        ao_radio_wait_isr(timeout);
-       if (ao_radio_abort)
+       if (ao_radio_abort) {
+               ret = 0;
                goto abort;
+       }
 
        ao_radio_reg_write(AO_CC1120_INT_GPIO_IOCFG, CC1120_IOCFG_GPIO_CFG_CLKEN_SOFT);
        ao_exti_set_mode(AO_CC1120_INT_PORT, AO_CC1120_INT_PIN,