homework 7
Dependencies: mbed-rtos mbed C12832_lcd LM75B
Diff: main.cpp
- Revision:
- 93:0e93e4a23f2b
- Parent:
- 92:be8d69aba1fc
- Child:
- 94:551b1df4b10c
diff -r be8d69aba1fc -r 0e93e4a23f2b main.cpp --- a/main.cpp Thu Sep 12 18:07:08 2013 +0000 +++ b/main.cpp Thu Sep 12 18:13:12 2013 +0000 @@ -209,11 +209,11 @@ // the message-receiving threads need 'else' for message-receive-timeout. - int dSeconds; - dSeconds = 8; +// int dSeconds; +// dSeconds = 8; - speakerThread((void *) &dSeconds); + // speakerThread((void *) &dSeconds); while(1) { @@ -333,11 +333,12 @@ int dButtonStart = 0; int dButtonStop = 0; int dDoorOpen = 0; + int dBeepSeconds = 0; osEvent queueEvent; // from button state manager. beepTimer.start(); // run the beep timer. - + dBeepSeconds = BEEPTIME; while(1) // thread loop. { @@ -438,6 +439,11 @@ led0 = 1; if (dFSMstate != dFSMstateLast) // if just entered state. { + + + Thread thread_beep(&speakerThread,(void *) &dBeepSeconds); + + beepTimer.reset(); // clear the beep timer. }