Mike Moore
/
RTOS_HW_04
RTOS homework 4
Diff: main.cpp
- Revision:
- 14:fb4c76ac43a1
- Parent:
- 13:d380d4ec3c5d
- Child:
- 15:7c0a94d2a439
--- a/main.cpp Sun Aug 18 18:53:44 2013 +0000 +++ b/main.cpp Sun Aug 18 19:02:25 2013 +0000 @@ -32,8 +32,8 @@ -----includes-----------------------------------//----------------------------*/ #include "mbed.h" // mbed class. + #include "C12832_lcd.h" // LCD class. #include "rtos.h" - #include "C12832_lcd.h" // LCD class. //---defines------------------------------------//------------------------------ #define LCD1 lcd.locate(0, 0); // LCD line 1. #define LCD2 lcd.locate(0,11); // LCD line 2. @@ -89,6 +89,7 @@ void ISR_left_falling(); void ISR_center(); void turn_off_metronome(); + void thread_start_display(void const *); //==============================================//============================== int main(void) { @@ -106,10 +107,11 @@ initialization(); // metronome ticker. - tickerMetronome.attach(&interrupt_service_M,fMetroDelay); +// tickerMetronome.attach(&interrupt_service_M,fMetroDelay); - // LCD ticker. - tickerLCD.attach(&lcd_display,LCDSAMPLERATE); + Thread threadDisplay(thread_start_display); + + while(1) { @@ -300,4 +302,12 @@ void led3_off(void) {led3 = 0;} // turn off the LED. /*----------------------------------------------//----------------------------*/ void led3_on( void) {led3 = 1;} // turn on the led. -/*----------------------------------------------//----------------------------*/ \ No newline at end of file +/*----------------------------------------------//----------------------------*/ + void thread_start_display(void const *) + { + // LCD ticker. + tickerLCD.attach(&lcd_display,LCDSAMPLERATE); + + } +/*----------------------------------------------//----------------------------*/ + \ No newline at end of file