summaryrefslogtreecommitdiff
path: root/altosui/AltosEepromChunk.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-08-13 18:36:18 -0700
committerKeith Packard <keithp@keithp.com>2011-08-13 18:46:12 -0700
commit5a3e96bef31959a287b8696778d7d8cf911a7dc4 (patch)
treeff79067dfa7e8cc2477016717951338d789a1e5d /altosui/AltosEepromChunk.java
parentb0ec30de37aa822ba66d25ceaa8cf8dc967b4371 (diff)
altosui: Clean up eeprom parsing a bit
Export basic parsing and checksum functions for shared use. Create 'erased' function to check a chunk of eeprom data for data. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosEepromChunk.java')
-rw-r--r--altosui/AltosEepromChunk.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/altosui/AltosEepromChunk.java b/altosui/AltosEepromChunk.java
index 1e42077f..fb632a3f 100644
--- a/altosui/AltosEepromChunk.java
+++ b/altosui/AltosEepromChunk.java
@@ -52,6 +52,13 @@ public class AltosEepromChunk {
return data[offset] | (data[offset + 1] << 8);
}
+ boolean erased(int start, int len) {
+ for (int i = 0; i < len; i++)
+ if (data[start+i] != 0xff)
+ return false;
+ return true;
+ }
+
public AltosEepromChunk(AltosSerial serial_line, int block)
throws TimeoutException, InterruptedException {