From 0641326842bffbf4b3ae69459ca540131cb64e59 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 9 May 2017 02:31:04 -0700 Subject: altoslib: Remove older eeprom handling code The new code appears to work in minor testing; time to try it all the time. Signed-off-by: Keith Packard --- altoslib/AltosStateIterable.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'altoslib/AltosStateIterable.java') diff --git a/altoslib/AltosStateIterable.java b/altoslib/AltosStateIterable.java index 5332aecd..ec3d944d 100644 --- a/altoslib/AltosStateIterable.java +++ b/altoslib/AltosStateIterable.java @@ -29,15 +29,13 @@ public abstract class AltosStateIterable implements Iterable { public abstract void write(PrintStream out); public static AltosStateIterable iterable(File file) { - FileInputStream in; try { - in = new FileInputStream(file); + if (file.getName().endsWith("telem")) + return new AltosTelemetryFile(new FileInputStream(file)); + else + return new AltosEepromFile(new FileReader(file)); } catch (Exception e) { return null; } - if (file.getName().endsWith("telem")) - return new AltosTelemetryFile(in); - else - return new AltosEepromFile(in); } } -- cgit v1.2.3