From: Keith Packard Date: Wed, 17 Oct 2012 04:54:23 +0000 (-0700) Subject: altosui: Accept serial number of zero for eeprom download X-Git-Tag: 1.1.9.1~9 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=440365bd17d804c2f574c35164612cf1682397d7 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 --- 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 { 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 */