Hlimi Omar
/
biniou
TRR2018 omar
Fork of biniou by
main.cpp@29:fc984fe08ca7, 2018-09-18 (annotated)
- Committer:
- GaspardD
- Date:
- Tue Sep 18 18:28:19 2018 +0000
- Revision:
- 29:fc984fe08ca7
- Parent:
- 27:f8c3f1524a64
- Child:
- 33:88d8f254c0b7
verifier le bon fonctionnement ? l'aide de; #if DEBUG > 0 ; pc.printf("debug message\r\n");; #endif
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GaspardD | 8:1d8c3ca5e508 | 1 | #include "stateMachines.h" |
GaspardD | 23:04d393220daa | 2 | Timer timerLoop; |
ohlimi2 | 1:abed67ad1d03 | 3 | |
GaspardD | 29:fc984fe08ca7 | 4 | #if DEBUG >= -1 |
GaspardD | 29:fc984fe08ca7 | 5 | InterruptIn dump_button(USER_BUTTON); |
GaspardD | 29:fc984fe08ca7 | 6 | #endif |
GaspardD | 29:fc984fe08ca7 | 7 | |
ohlimi2 | 1:abed67ad1d03 | 8 | int main() |
ohlimi2 | 1:abed67ad1d03 | 9 | { |
GaspardD | 29:fc984fe08ca7 | 10 | #if DEBUG >= -1 |
GaspardD | 29:fc984fe08ca7 | 11 | dump_button.fall(&pressed); |
GaspardD | 29:fc984fe08ca7 | 12 | initSamples(); |
GaspardD | 29:fc984fe08ca7 | 13 | #endif |
GaspardD | 29:fc984fe08ca7 | 14 | initIntegrationTable(); |
GaspardD | 23:04d393220daa | 15 | mursInit(); |
GaspardD | 11:bc24b3ba51a9 | 16 | #ifdef DLVV |
GaspardD | 23:04d393220daa | 17 | obstacleInit(); |
GaspardD | 23:04d393220daa | 18 | #endif |
GaspardD | 23:04d393220daa | 19 | sectionInit(); |
GaspardD | 23:04d393220daa | 20 | maxSpeedInit(); |
GaspardD | 23:04d393220daa | 21 | throttleInit(); |
GaspardD | 23:04d393220daa | 22 | timerLoop.start(); |
GaspardD | 23:04d393220daa | 23 | while (1) { |
GaspardD | 11:bc24b3ba51a9 | 24 | |
GaspardD | 27:f8c3f1524a64 | 25 | if(timerLoop.read_us()>20000) { // output every 20 ms |
GaspardD | 23:04d393220daa | 26 | timerLoop.reset(); |
GaspardD | 23:04d393220daa | 27 | timerLoop.start(); |
GaspardD | 23:04d393220daa | 28 | mursUpdate(); |
GaspardD | 23:04d393220daa | 29 | #ifdef DLVV |
GaspardD | 23:04d393220daa | 30 | obstacleUpdate(); |
GaspardD | 23:04d393220daa | 31 | #endif |
GaspardD | 27:f8c3f1524a64 | 32 | |
GaspardD | 27:f8c3f1524a64 | 33 | sectionUpdate(); |
GaspardD | 27:f8c3f1524a64 | 34 | maxSpeedUpdate(); |
GaspardD | 27:f8c3f1524a64 | 35 | throttleUpdate(); |
GaspardD | 11:bc24b3ba51a9 | 36 | |
ohlimi2 | 1:abed67ad1d03 | 37 | |
GaspardD | 27:f8c3f1524a64 | 38 | mursOutput(); |
GaspardD | 23:04d393220daa | 39 | #ifdef DLVV |
GaspardD | 27:f8c3f1524a64 | 40 | obstacleOutput(); |
GaspardD | 23:04d393220daa | 41 | #endif |
GaspardD | 27:f8c3f1524a64 | 42 | sectionOutput(); |
GaspardD | 27:f8c3f1524a64 | 43 | maxSpeedOutput(); |
GaspardD | 27:f8c3f1524a64 | 44 | throttleOutput(); |
GaspardD | 27:f8c3f1524a64 | 45 | } |
GaspardD | 23:04d393220daa | 46 | #ifdef SAMPLING |
GaspardD | 27:f8c3f1524a64 | 47 | sampleLog(); |
GaspardD | 23:04d393220daa | 48 | #endif |
GaspardD | 23:04d393220daa | 49 | |
ohlimi2 | 1:abed67ad1d03 | 50 | } |
GaspardD | 29:fc984fe08ca7 | 51 | } |