diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-01-20 12:27:20 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-01-20 12:27:20 +0100 |
commit | c8f52f8271c5f2a048d8849efe656c5391da29ba (patch) | |
tree | 76aa844d0776e317c56ef2b34182d19dfc2a1fc5 /src/display.cc | |
parent | abf69bd53f86300d263d3abeeae81a9e1c3cd5c0 (diff) |
move display and modem code from ISR to class functions
Diffstat (limited to 'src/display.cc')
-rw-r--r-- | src/display.cc | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/display.cc b/src/display.cc index 4215983..30a441f 100644 --- a/src/display.cc +++ b/src/display.cc @@ -9,8 +9,6 @@ Display display; -uint8_t teststr[] = {'O', 'h', 'a', 'i', '!', 0}; - void Display::disable() { TIMSK0 &= ~_BV(TOIE0); @@ -30,15 +28,7 @@ void Display::enable() TIMSK0 = _BV(TOIE0); } -/* - * Draws a single display column. This function should be called at least once - * per millisecond. - * - * Current configuration: - * Called every 256 microseconds. The whole display is refreshed every 2048us, - * giving a refresh rate of ~500Hz - */ -ISR(TIMER0_OVF_vect) +void Display::multiplex() { static uint8_t active_col = 0; static uint16_t scroll = 0; @@ -89,3 +79,16 @@ ISR(TIMER0_OVF_vect) } } } + +/* + * Draws a single display column. This function should be called at least once + * per millisecond. + * + * Current configuration: + * Called every 256 microseconds. The whole display is refreshed every 2048us, + * giving a refresh rate of ~500Hz + */ +ISR(TIMER0_OVF_vect) +{ + display.multiplex(); +} |