altoslib: Handle TeleBT v4.0 battery voltage
authorKeith Packard <keithp@keithp.com>
Sat, 13 May 2017 22:21:40 +0000 (15:21 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 13 May 2017 22:29:13 +0000 (15:29 -0700)
The device reports raw ADC values, which mean AltosLib needs to
translate them.

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

index 76a4eb31c6cc1e6eef952088dbb25a451bf4fa70..d75c9aa0c6e8f8d9a924e23842634f87cf0b0cb5 100644 (file)
@@ -556,7 +556,7 @@ public abstract class AltosLink implements Runnable {
                        return AltosLib.MISSING;
 
                double  volts = AltosLib.MISSING;
-               if (config_data.product.startsWith("TeleBT-v3")) {
+               if (config_data.product.startsWith("TeleBT-v3") || config_data.product.startsWith("TeleBT-v4")) {
                        volts = AltosConvert.tele_bt_3_battery(monitor_batt);
                } else {
                        volts = AltosConvert.cc_battery_to_voltage(monitor_batt);