DP
Dependencies: FastAnalogIn mbed-rtos mbed
Fork of dipl_prace_v10 by
main.cpp@1:28d74f044818, 2015-04-28 (annotated)
- Committer:
- romankrej
- Date:
- Tue Apr 28 18:48:50 2015 +0000
- Revision:
- 1:28d74f044818
- Parent:
- 0:f3b355df6f26
DP
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
romankrej | 0:f3b355df6f26 | 1 | #include "mbed.h" |
romankrej | 0:f3b355df6f26 | 2 | #include "rtos.h" |
romankrej | 0:f3b355df6f26 | 3 | #include "threads.h" |
romankrej | 0:f3b355df6f26 | 4 | #include "ultrasonic.h" |
romankrej | 0:f3b355df6f26 | 5 | #include "ledsensor.h" |
romankrej | 0:f3b355df6f26 | 6 | #include "can.h" |
romankrej | 0:f3b355df6f26 | 7 | #include "control.h" |
romankrej | 0:f3b355df6f26 | 8 | #include "print.h" |
romankrej | 0:f3b355df6f26 | 9 | |
romankrej | 0:f3b355df6f26 | 10 | |
romankrej | 0:f3b355df6f26 | 11 | int main() { |
romankrej | 0:f3b355df6f26 | 12 | Thread threadInit(initThread,NULL,osPriorityHigh); |
romankrej | 0:f3b355df6f26 | 13 | |
romankrej | 0:f3b355df6f26 | 14 | Thread threadUs(usThread,NULL,osPriorityHigh); |
romankrej | 0:f3b355df6f26 | 15 | Thread threadLaser(laserThread,NULL,osPriorityHigh); |
romankrej | 0:f3b355df6f26 | 16 | if(sensor == ULTRA) { |
romankrej | 0:f3b355df6f26 | 17 | threadLaser.terminate(); |
romankrej | 0:f3b355df6f26 | 18 | } |
romankrej | 0:f3b355df6f26 | 19 | if(sensor == LASER) |
romankrej | 0:f3b355df6f26 | 20 | threadUs.terminate(); |
romankrej | 1:28d74f044818 | 21 | Thread threadSync(syncThread,NULL,osPriorityAboveNormal); |
romankrej | 1:28d74f044818 | 22 | Thread threadControl(controlThread,NULL,osPriorityHigh); |
romankrej | 1:28d74f044818 | 23 | Thread threadCollect(collectThread,NULL,osPriorityRealtime); |
romankrej | 1:28d74f044818 | 24 | Thread threadPrint(printThread,NULL,osPriorityLow); |
romankrej | 1:28d74f044818 | 25 | Thread threadLed(ledThread,NULL,osPriorityAboveNormal); |
romankrej | 0:f3b355df6f26 | 26 | |
romankrej | 0:f3b355df6f26 | 27 | butOff.rise(&stopProg); |
romankrej | 0:f3b355df6f26 | 28 | us100.thread = &threadCollect; |
romankrej | 0:f3b355df6f26 | 29 | baumer.thread = &threadCollect; |
romankrej | 0:f3b355df6f26 | 30 | can.thread = &threadCollect; |
romankrej | 0:f3b355df6f26 | 31 | |
romankrej | 0:f3b355df6f26 | 32 | Thread::wait(osWaitForever); |
romankrej | 0:f3b355df6f26 | 33 | } |