diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-02-27 16:45:29 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-02-27 16:45:29 +0100 |
commit | d9c2688b77dcdf90d11cfa520bbd56ad73863e53 (patch) | |
tree | 01c8c0e6f7397cc0dcb72840570ea17d5f312b32 /src | |
parent | 15e021913a1fbd8ead848dc15bb2aab5f2e5534b (diff) |
disable animation switcher when storage is empty (closes #1)
Diffstat (limited to 'src')
-rw-r--r-- | src/storage.cc | 1 | ||||
-rw-r--r-- | src/system.cc | 3 |
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); |