Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-dsp
Fork of mbed-os-example-blinky by
Diff: main.cpp
- Revision:
- 48:d147eba868c8
- Parent:
- 47:b9abb45fde85
- Child:
- 49:2632e3e89576
diff -r b9abb45fde85 -r d147eba868c8 main.cpp --- a/main.cpp Wed Mar 29 15:50:15 2017 +0000 +++ b/main.cpp Thu Mar 30 10:39:04 2017 +0000 @@ -5,36 +5,36 @@ // State machine int STATE; //const int NONE = -1; -const int IDLE_LISTEN = 0; -const int CALC_DELTA_T = 1; -const int CALC_DELTA_S = 2; -const int CALC_DELTA_PHI = 3; -const int SEND = 4; +const int IDLE = 0; +const int LISTEN = 1; +const int CALC = 2; +const int SEND = 3; +const int ERROR = 4; //const int WAIT = 9; // main() runs in its own thread in the OS int main() { - STATE = IDLE_LISTEN; + STATE = IDLE; while (true) { switch (STATE) { - case IDLE_LISTEN: + case IDLE: //code here - STATE = CALC_DELTA_T; + STATE = LISTEN; //next state break; - case CALC_DELTA_T: + case LISTEN: + //code here + break; + + case CALC: //code here break; - case CALC_DELTA_S: + case ERROR: //code here break; - case CALC_DELTA_PHI: - // code here - break; - case SEND: // code here break;