From 1c3b2fe357d6acf28f48aeddd91693f10381be51 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 31 Jul 2010 10:05:15 -0700 Subject: [PATCH] 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 --- ao-tools/altosui/AltosEepromDownload.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.30.2