ichiro shirasaka
/
scheduler-demo-cq-lpc11u35
Scheduller Demo
Fork of scheduler-demo-cq-lpc11u35 by
main.cpp@3:d098b01b9dcb, 2014-05-18 (annotated)
- Committer:
- jr1wfh
- Date:
- Sun May 18 03:53:18 2014 +0000
- Revision:
- 3:d098b01b9dcb
- Parent:
- 2:6b3e85379edd
Rev.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mimi3 | 0:79e298c7d4b9 | 1 | |
mimi3 | 0:79e298c7d4b9 | 2 | #include "mbed.h" |
mimi3 | 0:79e298c7d4b9 | 3 | #include "Scheduler.h" |
mimi3 | 0:79e298c7d4b9 | 4 | #include "led_tsk.h" |
mimi3 | 0:79e298c7d4b9 | 5 | |
jr1wfh | 3:d098b01b9dcb | 6 | DigitalIn s1(P0_1); |
jr1wfh | 3:d098b01b9dcb | 7 | DigitalOut led2(P0_21); |
mimi3 | 1:48a906a94c32 | 8 | |
mimi3 | 0:79e298c7d4b9 | 9 | int main() |
mimi3 | 0:79e298c7d4b9 | 10 | { |
mimi3 | 1:48a906a94c32 | 11 | scheduler_startLoop( led1_task ); |
jr1wfh | 3:d098b01b9dcb | 12 | |
mimi3 | 0:79e298c7d4b9 | 13 | while(1) { |
jr1wfh | 3:d098b01b9dcb | 14 | if(s1 == 0){ //ISP SW ON? |
jr1wfh | 3:d098b01b9dcb | 15 | led2 = !led2; //Green LED ON/OFF |
jr1wfh | 3:d098b01b9dcb | 16 | taskWait(10); //Chattering wait 10ms |
jr1wfh | 3:d098b01b9dcb | 17 | while(s1 == 0){ //ISP SW OFF? |
jr1wfh | 3:d098b01b9dcb | 18 | taskWait(10); //Chattering wait 10ms |
jr1wfh | 3:d098b01b9dcb | 19 | } |
jr1wfh | 3:d098b01b9dcb | 20 | } |
jr1wfh | 3:d098b01b9dcb | 21 | taskWait(20); //Next check wait |
mimi3 | 0:79e298c7d4b9 | 22 | } |
jr1wfh | 3:d098b01b9dcb | 23 | } |
mimi3 | 1:48a906a94c32 | 24 | |
mimi3 | 1:48a906a94c32 | 25 | |
mimi3 | 1:48a906a94c32 | 26 |