summaryrefslogtreecommitdiff
path: root/src/storage.cc
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-02-21 11:30:35 +0100
committerDaniel Friesel <derf@finalrewind.org>2016-02-21 11:30:35 +0100
commitd75a6cd36db515a0863a03480d8e5c589a235e22 (patch)
tree247ba4ce0d3035d132d6a3548a5d9d8154bad1c4 /src/storage.cc
parent9e68d2ab92a2169478d6ec4b4d1f94026dfcf3dc (diff)
storage: Add hasData method
Diffstat (limited to 'src/storage.cc')
-rw-r--r--src/storage.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/storage.cc b/src/storage.cc
index 7ee5f4c..98a90f0 100644
--- a/src/storage.cc
+++ b/src/storage.cc
@@ -190,6 +190,14 @@ void Storage::reset()
i2c_write(0, 1, &num_anims);
}
+bool Storage::hasData()
+{
+ // Unprogrammed EEPROM pages always read 0xff
+ if (num_anims == 0xff)
+ return false;
+ return true;
+}
+
void Storage::load(uint16_t idx, uint8_t *data)
{
uint8_t page_offset;