altos: Compute desired frequency when upgrading from pre-1.1
authorKeith Packard <keithp@keithp.com>
Tue, 9 Oct 2012 04:59:55 +0000 (21:59 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 9 Oct 2012 04:59:55 +0000 (21:59 -0700)
Instead of just smashing the frequency to 434.550, compute the
frequency from the old radio channel value

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

index ce855ad1b51e1dcfdd6afb8d2d455fe45528e2d9..e8ff95b7f612da6da6864cfa3f838f43269adc6f 100644 (file)
@@ -102,6 +102,7 @@ _ao_config_get(void)
                ao_xmemset(&ao_config.callsign, '\0', sizeof (ao_config.callsign));
                ao_xmemcpy(&ao_config.callsign, CODE_TO_XDATA(AO_CONFIG_DEFAULT_CALLSIGN),
                       sizeof(AO_CONFIG_DEFAULT_CALLSIGN) - 1);
+               ao_config._legacy_radio_channel = 0;
        }
        minor = ao_config.minor;
        if (minor != AO_CONFIG_MINOR) {
@@ -131,7 +132,7 @@ _ao_config_get(void)
                if (minor < 9)
                        ao_xmemset(&ao_config.aes_key, '\0', AO_AES_LEN);
                if (minor < 10)
-                       ao_config.frequency = 434550;
+                       ao_config.frequency = 434550 + ao_config._legacy_radio_channel * 100;
                if (minor < 11)
                        ao_config.apogee_lockout = 0;
 #if AO_PYRO_NUM