altoslib: Flush settings restoration commands after accel cal
authorKeith Packard <keithp@keithp.com>
Thu, 26 Apr 2018 06:07:46 +0000 (23:07 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 27 Apr 2018 02:24:21 +0000 (19:24 -0700)
To avoid mangling settings when the user doesn't 'save' things,
restore the original accel cal values and orientation after finishing
accelerometer calibration.

Signed-off-by: Keith Packard <keithp@keithp.com>
altoslib/AltosAccelCal.java

index 03d9fbf27def2bc70aa75ffb99326798f814465c..75592d9e1b87c393708f801c9c68c91f18677956 100644 (file)
@@ -183,6 +183,7 @@ public class AltosAccelCal implements Runnable {
                                if (config_data.accel_cal_plus != AltosLib.MISSING && config_data.accel_cal_minus != AltosLib.MISSING)
                                        link.printf("c a %d %d\n",
                                                    config_data.accel_cal_plus, config_data.accel_cal_minus);
+                               link.flush_output();
                                stop_link();
                        }
                        if (new_config != null) {