diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-01-22 16:37:10 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-01-22 16:37:32 +0100 |
commit | b71f23b93acdd3aa28066bd6edc7bcb63d518bfe (patch) | |
tree | 76003f9fbb17e4b9c7d7806380052c0e6b2cf41e /src/display.cc | |
parent | 83d6a0ee679e73c89d0ba84602d3052527726230 (diff) |
display: Don't run (rather slow) scroll code in ISR
Diffstat (limited to 'src/display.cc')
-rw-r--r-- | src/display.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/display.cc b/src/display.cc index 42710c9..82c5020 100644 --- a/src/display.cc +++ b/src/display.cc @@ -37,8 +37,6 @@ void Display::enable() void Display::multiplex() { static uint16_t scroll; - uint8_t i, glyph_len; - uint8_t *glyph_addr; /* * To avoid flickering, do not put any code (or expensive index @@ -53,6 +51,15 @@ void Display::multiplex() if (++scroll == scroll_delay) { scroll = 0; + need_scroll = 1; + } +} + +void Display::scroll() { + uint8_t i, glyph_len; + uint8_t *glyph_addr; + if (need_scroll) { + need_scroll = 0; for (i = 0; i < 7; i++) { disp_buf[i] = disp_buf[i+1]; @@ -87,6 +94,11 @@ void Display::reset() char_pos = -1; } +void Display::setString(const char *new_str) +{ + setString((char *)new_str); +} + void Display::setString(char *new_str) { reset(); |