diff options
author | Keith Packard <keithp@keithp.com> | 2012-10-16 21:54:23 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-10-16 21:54:23 -0700 |
commit | 440365bd17d804c2f574c35164612cf1682397d7 (patch) | |
tree | 3f40e605dc2a5c2a2538443b8ef5a47b7a7057e6 | |
parent | 4d6d90e15db30991bf81060a0876ae8adb843c75 (diff) |
altosui: Accept serial number of zero for eeprom download
AVR-based products don't have a valid serial number, and so usually
report 0. Accept this by making the 'no serial number' case check for
negative values.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | altoslib/AltosConfigData.java | 1 | ||||
-rw-r--r-- | altosui/AltosEepromDownload.java | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/altoslib/AltosConfigData.java b/altoslib/AltosConfigData.java index 6f343639..a962b105 100644 --- a/altoslib/AltosConfigData.java +++ b/altoslib/AltosConfigData.java @@ -134,6 +134,7 @@ public class AltosConfigData implements Iterable<String> { radio_setting = 0; radio_frequency = 0; stored_flight = 0; + serial = -1; for (;;) { String line = link.get_reply(); if (line == null) diff --git a/altosui/AltosEepromDownload.java b/altosui/AltosEepromDownload.java index a8cb24ff..a5e99749 100644 --- a/altosui/AltosEepromDownload.java +++ b/altosui/AltosEepromDownload.java @@ -314,7 +314,7 @@ public class AltosEepromDownload implements Runnable { done = false; start = true; - if (flights.config_data.serial == 0) + if (flights.config_data.serial < 0) throw new IOException("no serial number found"); /* Reset per-capture variables */ |