summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-02-27 16:45:29 +0100
committerDaniel Friesel <derf@finalrewind.org>2016-02-27 16:45:29 +0100
commitd9c2688b77dcdf90d11cfa520bbd56ad73863e53 (patch)
tree01c8c0e6f7397cc0dcb72840570ea17d5f312b32
parent15e021913a1fbd8ead848dc15bb2aab5f2e5534b (diff)
disable animation switcher when storage is empty (closes #1)
-rw-r--r--src/storage.cc1
-rw-r--r--src/system.cc3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/storage.cc b/src/storage.cc
index 517fedf..d1c2ee1 100644
--- a/src/storage.cc
+++ b/src/storage.cc
@@ -248,7 +248,6 @@ bool Storage::hasData()
return num_anims;
}
-// TODO support multi-page reads
void Storage::load(uint8_t idx, uint8_t *data)
{
uint8_t page_offset;
diff --git a/src/system.cc b/src/system.cc
index fdf3e4d..d8c27ab 100644
--- a/src/system.cc
+++ b/src/system.cc
@@ -90,6 +90,9 @@ void System::initialize()
void System::loadPattern(uint8_t anim_no)
{
+ if (!storage.hasData())
+ return;
+
storage.load(anim_no, disp_buf);
active_anim.type = (AnimationType)(disp_buf[0] >> 4);