diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-02-24 17:28:53 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-02-24 17:28:53 +0100 |
commit | 6cc9c4fa5133e5b2e587735d2cd3cc9272fa7c8a (patch) | |
tree | 60635f12f9b730abfdd57cb6977a0b4e185f89ff /src/storage.cc | |
parent | 796805659b6478b6cafeaf743b1540050c3ccdce (diff) |
Add END/EOT signal, only write number of animations at EOT
Diffstat (limited to 'src/storage.cc')
-rw-r--r-- | src/storage.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/storage.cc b/src/storage.cc index 042b778..8b725be 100644 --- a/src/storage.cc +++ b/src/storage.cc @@ -237,6 +237,11 @@ void Storage::reset() num_anims = 0; } +void Storage::sync() +{ + i2c_write(0, 0, 1, &num_anims); +} + bool Storage::hasData() { // Unprogrammed EEPROM pages always read 0xff @@ -259,7 +264,6 @@ void Storage::load(uint8_t idx, uint8_t *data) void Storage::save(uint8_t *data) { num_anims++; - i2c_write(0, 0, 1, &num_anims); i2c_write(0, num_anims, 1, &first_free_page); append(data); } |