summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-02-23 23:12:05 +0100
committerDaniel Friesel <derf@finalrewind.org>2016-02-23 23:12:05 +0100
commit6585a5b6a4917331dec7686b8dd5efd2cae3393b (patch)
tree405d8c3344237ce19d9c2340cedf53b46b57c11c /src
parentcefc03d92aa34622424c675c16eca56da8c9f135 (diff)
display: Rename active_anim to current_anim to avoid name clash
Diffstat (limited to 'src')
-rw-r--r--src/display.cc18
-rw-r--r--src/display.h4
2 files changed, 11 insertions, 11 deletions
diff --git a/src/display.cc b/src/display.cc
index f9be78e..18e88be 100644
--- a/src/display.cc
+++ b/src/display.cc
@@ -45,7 +45,7 @@ void Display::multiplex()
if (++active_col == 8) {
active_col = 0;
- if (++scroll == active_anim->speed) {
+ if (++scroll == current_anim->speed) {
scroll = 0;
need_update = 1;
}
@@ -59,12 +59,12 @@ void Display::update() {
need_update = 0;
if (status == RUNNING) {
- if (active_anim->type == AnimationType::TEXT) {
+ if (current_anim->type == AnimationType::TEXT) {
for (i = 0; i < 7; i++) {
disp_buf[i] = disp_buf[i+1];
}
- glyph_addr = (uint8_t *)pgm_read_ptr(&font[active_anim->data[str_pos]]);
+ glyph_addr = (uint8_t *)pgm_read_ptr(&font[current_anim->data[str_pos]]);
glyph_len = pgm_read_byte(&glyph_addr[0]);
char_pos++;
@@ -78,21 +78,21 @@ void Display::update() {
} else {
disp_buf[7] = ~pgm_read_byte(&glyph_addr[char_pos]);
}
- } else if (active_anim->type == AnimationType::FRAMES) {
+ } else if (current_anim->type == AnimationType::FRAMES) {
for (i = 0; i < 8; i++) {
- disp_buf[i] = ~active_anim->data[str_pos+i];
+ disp_buf[i] = ~current_anim->data[str_pos+i];
}
str_pos += 8;
}
- if (str_pos >= active_anim->length) {
+ if (str_pos >= current_anim->length) {
str_pos = 0;
- if (active_anim->delay > 0) {
+ if (current_anim->delay > 0) {
status = PAUSED;
}
}
} else if (status == PAUSED) {
str_pos++;
- if (str_pos >= active_anim->delay) {
+ if (str_pos >= current_anim->delay) {
str_pos = 0;
status = RUNNING;
}
@@ -111,7 +111,7 @@ void Display::reset()
void Display::show(animation_t *anim)
{
- active_anim = anim;
+ current_anim = anim;
reset();
}
diff --git a/src/display.h b/src/display.h
index 8e1cca1..3a526b2 100644
--- a/src/display.h
+++ b/src/display.h
@@ -60,7 +60,7 @@ typedef struct animation animation_t;
*/
class Display {
private:
- animation_t *active_anim;
+ animation_t *current_anim;
uint8_t need_update;
uint8_t active_col;
uint8_t disp_buf[8];
@@ -106,7 +106,7 @@ class Display {
/**
* Update display content.
- * Checks active_anim->speed and active_anim->type and scrolls
+ * Checks current_anim->speed and current_anim->type and scrolls
* the text / advances a frame when appropriate. Does nothing
* otherwise.
*/