summaryrefslogtreecommitdiff
path: root/src/storage.cc
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-03-12 22:07:12 +0100
committerDaniel Friesel <derf@finalrewind.org>2016-03-12 22:07:12 +0100
commit0ee7d763090e32118829fb897ff8ad4261c3c27e (patch)
tree4b1c4084adb70f10dd99b45a243b3ce467b834a6 /src/storage.cc
parent31d40607ceaae5dcb78f41fcfe7dbd777f75d485 (diff)
>255byte pattern support, commit 2/2
Diffstat (limited to 'src/storage.cc')
-rw-r--r--src/storage.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/storage.cc b/src/storage.cc
index e965589..7cf404b 100644
--- a/src/storage.cc
+++ b/src/storage.cc
@@ -268,13 +268,8 @@ void Storage::load(uint8_t idx, uint8_t *data)
header[0] = data[0];
header[1] = data[1];
- if (header[0] & 0x0f) {
- // read whole byte block
- i2c_read(1 + (page_offset / 8), (page_offset % 8) * 32 + 4, 128, data + 4);
- i2c_read(1 + (page_offset / 8), (page_offset % 8) * 32 + 4 + 128, 128, data + 4 + 128);
- } else {
- i2c_read(1 + (page_offset / 8), (page_offset % 8) * 32 + 4, header[1], data + 4);
- }
+ // always read 128 bytes - the system will ignore trailing bytes
+ i2c_read(1 + (page_offset / 8), (page_offset % 8) * 32 + 4, 128, data + 4);
}
void Storage::loadChunk(uint8_t chunk, uint8_t *data)