altoslib: Remove hard-coded accel scale for mega eeprom
authorKeith Packard <keithp@keithp.com>
Tue, 25 Feb 2020 19:54:11 +0000 (11:54 -0800)
committerKeith Packard <keithp@keithp.com>
Tue, 25 Feb 2020 23:39:08 +0000 (15:39 -0800)
I don't know why this is using a hard-coded value which only matches
early TeleMega v1 boards.

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

index 168b352c652a8a67707a45bb5bb6c516568ea7c4..888fd3564bbcca435dbcd3e81c68668255aa0bf2 100644 (file)
@@ -287,16 +287,7 @@ public class AltosEepromRecordMega extends AltosEepromRecord {
                                         cal_data.mag_across(mag_across),
                                         cal_data.mag_through(mag_through));
 
                                         cal_data.mag_across(mag_across),
                                         cal_data.mag_through(mag_through));
 
-
-                       final double lsb_per_g = 1920.0/105.5;
-
-                       double acceleration = AltosConvert.acceleration_from_sensor(
-                               accel(),
-                               cal_data.ground_accel,
-                               cal_data.ground_accel + 2 * lsb_per_g,
-                               cal_data.ground_accel);
-
-                       listener.set_acceleration(acceleration);
+                       listener.set_acceleration(cal_data.acceleration(accel()));
                        break;
                case AltosLib.AO_LOG_TEMP_VOLT:
                        listener.set_battery_voltage(AltosConvert.mega_battery_voltage(v_batt()));
                        break;
                case AltosLib.AO_LOG_TEMP_VOLT:
                        listener.set_battery_voltage(AltosConvert.mega_battery_voltage(v_batt()));