From c8f52f8271c5f2a048d8849efe656c5391da29ba Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 20 Jan 2016 12:27:20 +0100 Subject: move display and modem code from ISR to class functions --- src/display.cc | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/display.cc') 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(); +} -- cgit v1.2.3