From: Keith Packard Date: Sat, 31 Jul 2010 17:05:15 +0000 (-0700) Subject: altosui: Capture config and version info in .eeprom files X-Git-Tag: debian/0.6+373+gcf65c6b~54 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=1c3b2fe357d6acf28f48aeddd91693f10381be51;ds=sidebyside altosui: Capture config and version info in .eeprom files Instead of only writing the serial number to the .eeprom file, write all of the config values and all of the version reply to the .eeprom file. The config values, in particular, contain the accelerometer calibration data which is needed to correctly compute acceleration from the captured accelerometer data. Signed-off-by: Keith Packard --- diff --git a/ao-tools/altosui/AltosEepromDownload.java b/ao-tools/altosui/AltosEepromDownload.java index 756b82d1..1f4a278f 100644 --- a/ao-tools/altosui/AltosEepromDownload.java +++ b/ao-tools/altosui/AltosEepromDownload.java @@ -103,7 +103,7 @@ public class AltosEepromDownload implements Runnable { AltosFile eeprom_name; LinkedList eeprom_pending = new LinkedList(); - serial_line.printf("v\n"); + serial_line.printf("\nc s\nv\n"); /* Pull the serial number out of the version information */ @@ -113,12 +113,13 @@ public class AltosEepromDownload implements Runnable { if (line.startsWith("serial-number")) { try { serial = Integer.parseInt(line.substring(13).trim()); - eeprom_pending.add(String.format("%s\n", line)); } catch (NumberFormatException ne) { serial = 0; } } + eeprom_pending.add(String.format("%s\n", line)); + /* signals the end of the version info */ if (line.startsWith("software-version")) break;