From: Keith Packard Date: Tue, 25 Feb 2020 19:54:11 +0000 (-0800) Subject: altoslib: Remove hard-coded accel scale for mega eeprom X-Git-Tag: 1.9.2~2^2~9 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=97cb2a808ad8853cead2d9722b7258b1b62df7a4 altoslib: Remove hard-coded accel scale for mega eeprom I don't know why this is using a hard-coded value which only matches early TeleMega v1 boards. Signed-off-by: Keith Packard --- diff --git a/altoslib/AltosEepromRecordMega.java b/altoslib/AltosEepromRecordMega.java index 168b352c..888fd356 100644 --- a/altoslib/AltosEepromRecordMega.java +++ b/altoslib/AltosEepromRecordMega.java @@ -287,16 +287,7 @@ public class AltosEepromRecordMega extends AltosEepromRecord { 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()));