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 <keithp@keithp.com>
AltosFile eeprom_name;
LinkedList<String> eeprom_pending = new LinkedList<String>();
AltosFile eeprom_name;
LinkedList<String> eeprom_pending = new LinkedList<String>();
- serial_line.printf("v\n");
+ serial_line.printf("\nc s\nv\n");
/* Pull the serial number out of the version information */
/* Pull the serial number out of the version information */
if (line.startsWith("serial-number")) {
try {
serial = Integer.parseInt(line.substring(13).trim());
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;
}
}
} 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;
/* signals the end of the version info */
if (line.startsWith("software-version"))
break;