Set all of the values to reset the radio for telemetry
authorKeith Packard <keithp@keithp.com>
Fri, 4 Sep 2009 19:25:37 +0000 (12:25 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 4 Sep 2009 19:25:37 +0000 (12:25 -0700)
Was sizeof(rdf_setup) instead of sizeof(telemetry_setup) when
resetting the radio back to telemetry data mode from rdf mode. With
the length value removed from the rdf config, these two arrays are no
longer the same length, and so the last config value was not set
leaving the radio sending garbage.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/ao_radio.c

index 76fa3e5dc497eb5f6913ca15e3fce8354cd8b2ff..a7fa682e11dbf44701a3ee0fc9e51193dd6f880f 100644 (file)
@@ -222,7 +222,7 @@ static __code uint8_t rdf_setup[] = {
        RF_DEVIATN_OFF,         ((RDF_DEVIATION_E << RF_DEVIATN_DEVIATION_E_SHIFT) |
                                 (RDF_DEVIATION_M << RF_DEVIATN_DEVIATION_M_SHIFT)),
 
        RF_DEVIATN_OFF,         ((RDF_DEVIATION_E << RF_DEVIATN_DEVIATION_E_SHIFT) |
                                 (RDF_DEVIATION_M << RF_DEVIATN_DEVIATION_M_SHIFT)),
 
-       /* packet length */
+       /* packet length is set in-line */
        RF_PKTCTRL1_OFF,        ((1 << PKTCTRL1_PQT_SHIFT)|
                                 PKTCTRL1_ADR_CHK_NONE),
        RF_PKTCTRL0_OFF,        (RF_PKTCTRL0_PKT_FORMAT_NORMAL|
        RF_PKTCTRL1_OFF,        ((1 << PKTCTRL1_PQT_SHIFT)|
                                 PKTCTRL1_ADR_CHK_NONE),
        RF_PKTCTRL0_OFF,        (RF_PKTCTRL0_PKT_FORMAT_NORMAL|
@@ -362,7 +362,7 @@ ao_radio_rdf(int ms)
                ao_sleep(&ao_radio_dma_done);
        ao_radio_rdf_running = 0;
        ao_radio_idle();
                ao_sleep(&ao_radio_dma_done);
        ao_radio_rdf_running = 0;
        ao_radio_idle();
-       for (i = 0; i < sizeof (rdf_setup); i += 2)
+       for (i = 0; i < sizeof (telemetry_setup); i += 2)
                RF[telemetry_setup[i]] = telemetry_setup[i+1];
        ao_mutex_put(&ao_radio_mutex);
 }
                RF[telemetry_setup[i]] = telemetry_setup[i+1];
        ao_mutex_put(&ao_radio_mutex);
 }