altos/micropeak: Clock micropeak at 250kHz to save power
[fw/altos] / altosui / AltosConfig.java
index be9ab8bf6b1f51a1e7a9d3b70b8c7aaf8b76b692..4b0edec0fbf5492aa48501c5e9ab2540f121d65c 100644 (file)
@@ -393,8 +393,10 @@ public class AltosConfig implements ActionListener {
        }
 
        void abort() {
-               serial_line.close();
-               serial_line = null;
+               if (serial_line != null) {
+                       serial_line.close();
+                       serial_line = null;
+               }
                JOptionPane.showMessageDialog(owner,
                                              String.format("Connection to \"%s\" failed",
                                                            device.toShortString()),
@@ -515,7 +517,7 @@ public class AltosConfig implements ActionListener {
                        try {
                                serial_line = new AltosSerial(device);
                                try {
-                                       if (!device.matchProduct(Altos.product_altimeter))
+                                       if (device.matchProduct(Altos.product_basestation))
                                                remote = true;
                                        init_ui();
                                } catch (InterruptedException ie) {