From df276262900551a5eecd94903eefe9a264b161ec Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 15 May 2016 13:58:41 -0700 Subject: [PATCH] telegps: Use log_space when flight_log_max is missing TeleGPS has this, but not flight_log_max Signed-off-by: Keith Packard --- telegps/TeleGPSState.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/telegps/TeleGPSState.java b/telegps/TeleGPSState.java index a0ff5727..e01ef47e 100644 --- a/telegps/TeleGPSState.java +++ b/telegps/TeleGPSState.java @@ -136,10 +136,13 @@ public class TeleGPSState extends AltosUIFlightTab { class FlightLogMax extends AltosUIIndicator { public void show(AltosState state, AltosListenerState listener_state) { - if (state.flight_log_max == AltosLib.MISSING) + int storage = state.flight_log_max; + if (storage == AltosLib.MISSING) + storage = state.log_space >> 10; + if (storage == AltosLib.MISSING) show("Missing"); else - show(String.format("%dkB", state.flight_log_max)); + show(String.format("%dkB", storage)); } public FlightLogMax(Container container, int y) { -- 2.30.2