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.
Diff: main.cpp
- Revision:
- 1:cb6811ef87de
- Parent:
- 0:249f6f78cd05
- Child:
- 2:45db4f4ca70d
--- a/main.cpp Fri Jul 12 05:16:46 2013 +0000 +++ b/main.cpp Fri Jul 12 17:14:01 2013 +0000 @@ -10,42 +10,20 @@ char sel; pc.baud(115200); //config buad rate + state = MODE_IDLE; while(1) { - while(' ' != pc.getc()); //press space to start - - pc.printf("%s", main_menu); - sel = pc.getc(); - - state = sel - '0'; - - if(state<=0 || state>=8) - state = MODE_ERR; - - switch(sel) + switch(state) { - case MODE_CHA1PHA: - pc.printf("%s", cmd1); + case MODE_IDLE: + pc.printf("%s", main_menu); + sel = pc.getc(); + mode_idle_handler(&state, sel); + pc.printf("%d", state); break; - case MODE_CHA1AMP: - pc.printf("%s", cmd2); - break; - case MODE_CHA2PHA: - pc.printf("%s", cmd3); - break; - case MODE_CHAAMP: - pc.printf("%s", cmd4); - break; - case MODE_DISPLAY: - pc.printf("\n"); - break; - case MODE_SEND: - pc.printf("parameters send\n"); - break; - case MODE_ERR: + } - } }