summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-02-01 20:35:31 +0100
committerDaniel Friesel <derf@finalrewind.org>2016-02-01 20:35:31 +0100
commit9d840bb688844458e7ba270ddbb1944d40c317ec (patch)
treec6660e33147f05a18854108017a58b57ef199a36
parentdbad58b5c781db9fe2c1ac695b526a1035d13749 (diff)
rename animation.mode to more appropriate animation.type
-rw-r--r--src/display.cc4
-rw-r--r--src/display.h10
-rw-r--r--src/main.cc4
3 files changed, 9 insertions, 9 deletions
diff --git a/src/display.cc b/src/display.cc
index ab40a1e..ce7b466 100644
--- a/src/display.cc
+++ b/src/display.cc
@@ -58,7 +58,7 @@ void Display::update() {
if (need_update) {
need_update = 0;
- if (active_anim->mode == AnimationType::TEXT) {
+ if (active_anim->type == AnimationType::TEXT) {
for (i = 0; i < 7; i++) {
disp_buf[i] = disp_buf[i+1];
}
@@ -77,7 +77,7 @@ void Display::update() {
} else {
disp_buf[7] = ~pgm_read_byte(&glyph_addr[char_pos]);
}
- } else if (active_anim->mode == AnimationType::FRAMES) {
+ } else if (active_anim->type == AnimationType::FRAMES) {
for (i = 0; i < 8; i++) {
disp_buf[i] = ~active_anim->data[str_pos+i];
}
diff --git a/src/display.h b/src/display.h
index 9437113..5dd6bfe 100644
--- a/src/display.h
+++ b/src/display.h
@@ -19,7 +19,7 @@ struct animation {
* Specific kind of animation described in this struct. Controls the
* behaviour of Display::multiplex() and Display::update().
*/
- AnimationType mode;
+ AnimationType type;
/**
* Length of data in bytes
@@ -27,8 +27,8 @@ struct animation {
uint8_t length;
/**
- * * If mode == AnimationType::TEXT: Text scroll speed in columns per TODO
- * * If mode == FRAMES: Frames per TODO
+ * * If type == AnimationType::TEXT: Text scroll speed in columns per TODO
+ * * If type == AnimationType::FRAMES: Frames per TODO
*/
uint8_t speed;
@@ -43,9 +43,9 @@ struct animation {
uint8_t direction;
/**
- * * If mode == AnimationType::TEXT: character array pointing to the
+ * * If type == AnimationType::TEXT: character array pointing to the
* animation text in standard ASCII format (+ special font chars)
- * * If mode == FRAMES: Frame array. Each element encodes
+ * * If type == AnimationType::FRAMES: Frame array. Each element encodes
* a display column (starting with the leftmost one), each group of
* eight elements is a frame.
*/
diff --git a/src/main.cc b/src/main.cc
index 5afa6d7..160406c 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -10,7 +10,7 @@ animation_t ohai;
int main (void)
{
- ohai.mode = AnimationType::TEXT;
+ ohai.type = AnimationType::TEXT;
ohai.speed = (2 << 4) + 15;
ohai.data = (uint8_t *)"\001 Ohai ";
ohai.length = 8;
@@ -18,7 +18,7 @@ int main (void)
uint8_t anim_data[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0 };
animation_t test;
- test.mode = AnimationType::FRAMES;
+ test.type = AnimationType::FRAMES;
test.speed = 14;
test.length = 2*8;
test.data = anim_data;