diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-01-28 15:05:15 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-01-28 15:05:15 +0100 |
commit | edf5f5ab92520b6af3151bca2b97c618a9d1d7f9 (patch) | |
tree | 29f710563194c1fbe6fcfc5dffa892bb6e204710 /src/main.cc | |
parent | c079af446d61c892b867a9ab4efd2e496dfb9cce (diff) |
merge text_t and animation_t into single animation type to reduce code and memory overhead
Diffstat (limited to 'src/main.cc')
-rw-r--r-- | src/main.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main.cc b/src/main.cc index 76a2046..a8fb5d3 100644 --- a/src/main.cc +++ b/src/main.cc @@ -12,14 +12,19 @@ int main (void) { - text_t ohai; + animation_t ohai; + ohai.mode = AnimationType::TEXT; ohai.speed = (4 << 4) + 15; - ohai.str = (uint8_t *)"Ohai! "; + ohai.data = (uint8_t *)"Ohai! "; + ohai.length = 6; - //uint8_t anim_data[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0 }; + uint8_t anim_data[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0 }; - //animation_t test; - //test.data = anim_data; + animation_t test; + test.mode = AnimationType::FRAMES; + test.speed = 14; + test.length = 2*8; + test.data = anim_data; // disable ADC to save power PRR |= _BV(PRADC); @@ -30,7 +35,7 @@ int main (void) // Enable pull-ups on PC3 and PC7 (button pins) PORTC |= _BV(PC3) | _BV(PC7); - display.show(ohai); + display.show(&ohai); display.enable(); modem.enable(); |