altoslib: unconfigured radio frequency data is now -1, not 0
authorKeith Packard <keithp@keithp.com>
Sun, 16 Dec 2012 21:25:54 +0000 (13:25 -0800)
committerKeith Packard <keithp@keithp.com>
Sun, 16 Dec 2012 21:25:54 +0000 (13:25 -0800)
This changed when AltosConfigData was cleaned up, so now frequency
settings must check for positive numbers rather than non-zero.

Signed-off-by: Keith Packard <keithp@keithp.com>

altoslib/AltosLink.java

index 6d51056..1b72202 100644 (file)
@@ -284,8 +284,8 @@ public abstract class AltosLink implements Runnable {
                frequency = in_frequency;
                config_data();
                set_radio_frequency(frequency,
-                                   config_data.radio_frequency != 0,
-                                   config_data.radio_setting != 0,
+                                   config_data.radio_frequency > 0,
+                                   config_data.radio_setting > 0,
                                    config_data.radio_calibration);
        }
 
@@ -339,10 +339,10 @@ public abstract class AltosLink implements Runnable {
        public String name;
 
        public void start_remote() throws TimeoutException, InterruptedException {
-               if (debug)
-                       System.out.printf("start remote %7.3f\n", frequency);
                if (frequency == 0.0)
                        frequency = AltosPreferences.frequency(serial);
+               if (debug)
+                       System.out.printf("start remote %7.3f\n", frequency);
                set_radio_frequency(frequency);
                set_callsign(AltosPreferences.callsign());
                printf("p\nE 0\n");