mp3 play, wait and sync by semaphore *player thread *volume control thread
Dependencies: mbed VS1053-Semaphore VS1053b
main.cpp@0:5c606d6342db, 2012-03-19 (annotated)
- Committer:
- takashikojo
- Date:
- Mon Mar 19 12:12:24 2012 +0000
- Revision:
- 0:5c606d6342db
Thread based mp3 player with mbed RTOS, semaphore
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
takashikojo | 0:5c606d6342db | 1 | #include "mbed.h" |
takashikojo | 0:5c606d6342db | 2 | #include "rtos.h" |
takashikojo | 0:5c606d6342db | 3 | |
takashikojo | 0:5c606d6342db | 4 | extern void main_mp3(void const *) ; |
takashikojo | 0:5c606d6342db | 5 | DigitalOut led1(LED1); |
takashikojo | 0:5c606d6342db | 6 | |
takashikojo | 0:5c606d6342db | 7 | int main() { |
takashikojo | 0:5c606d6342db | 8 | |
takashikojo | 0:5c606d6342db | 9 | Thread t(main_mp3 , NULL, osPriorityNormal, (DEFAULT_STACK_SIZE * 2.25)); |
takashikojo | 0:5c606d6342db | 10 | |
takashikojo | 0:5c606d6342db | 11 | while (true) { |
takashikojo | 0:5c606d6342db | 12 | led1 = 1 ; |
takashikojo | 0:5c606d6342db | 13 | Thread::wait(1000); |
takashikojo | 0:5c606d6342db | 14 | led1 = 0 ; |
takashikojo | 0:5c606d6342db | 15 | } |
takashikojo | 0:5c606d6342db | 16 | } |