projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Fix mini/nano default log size to available flash space
[fw/altos]
/
altosui
/
AltosEepromRecord.java
diff --git
a/altosui/AltosEepromRecord.java
b/altosui/AltosEepromRecord.java
index 584a04b7c6c053e9a261f1368a603bbb1790c844..e5196c50039a69434d36bd661f612ad50bb3ae08 100644
(file)
--- a/
altosui/AltosEepromRecord.java
+++ b/
altosui/AltosEepromRecord.java
@@
-72,15
+72,24
@@
public class AltosEepromRecord {
if (values[0] != (addr & 0xff))
throw new ParseException(String.format("data address out of sync at 0x%x",
addr), 0);
if (values[0] != (addr & 0xff))
throw new ParseException(String.format("data address out of sync at 0x%x",
addr), 0);
- if (checksum(values) != 0)
- throw new ParseException(String.format("invalid checksum at 0x%x", addr), 0);
-
+ int i;
+ for (i = 1; i < values.length; i++)
+ if (values[i] != 0xff)
+ break;
cmd = values[1];
cmd = values[1];
+ tick_valid = true;
+ if (i != values.length) {
+ if (checksum(values) != 0)
+ throw new ParseException(String.format("invalid checksum at 0x%x in line %s", addr, line), 0);
+ } else {
+ cmd = Altos.AO_LOG_INVALID;
+ tick_valid = false;
+ }
+
tick = values[3] + (values[4] << 8);
a = values[5] + (values[6] << 8);
b = values[7] + (values[8] << 8);
data = null;
tick = values[3] + (values[4] << 8);
a = values[5] + (values[6] << 8);
b = values[7] + (values[8] << 8);
data = null;
- tick_valid = true;
}
public AltosEepromRecord (String line) {
}
public AltosEepromRecord (String line) {