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
Diff: src/menu.cpp
- Revision:
- 3:d8948c5b2951
- Parent:
- 1:9f8583ba2431
- Child:
- 5:09be5bbb5020
diff -r 46faae84b8b0 -r d8948c5b2951 src/menu.cpp --- a/src/menu.cpp Sun Nov 25 01:23:33 2018 +0000 +++ b/src/menu.cpp Tue Nov 27 17:47:57 2018 +0000 @@ -49,4 +49,42 @@ sendSerial(strbuf); sprintf(strbuf, "\r\nSTOP"); sendSerial(strbuf); + + menuPrompt(MENU_DCM1); +} + +// sends carriage return and linefeed and prompt character +void menuPrompt(int menuType) +{ + char strMenu[30] ={0}; + + switch(menuType) + { + case MENU_DCM1: strcpy(strMenu,"DCM1"); break; + //case MENU_DIFFERENTIAL: strcpy(strMenu,"DIFF"); break; + //case MENU_SINGLE: strcpy(strMenu,"SINGLE"); break; + //case MENU_DUAL: strcpy(strMenu,"DUAL"); break; + //case MENU_INVERT: strcpy(strMenu,"INVERT"); break; + //case MENU_SETTINGS: strcpy(strMenu,"SET"); break; + //case MENU_SETTINGS_CHAN1: strcpy(strMenu,"SET CHAN1"); break; + //case MENU_SETTINGS_CHAN2: strcpy(strMenu,"SET CHAN2"); break; + //case MENU_SETTINGS_CLOCK: strcpy(strMenu,"SET CLOCK"); break; + case MENU_CALIBRATE: strcpy(strMenu,"CAL"); break; + case MENU_TEST: strcpy(strMenu,"TEST"); break; + case MENU_MAIN: strcpy(strMenu,"MAIN"); break; + default: strcpy(strMenu,"UNDF"); break; + } + + // append the CR,LF and the ready character + if(serialStatus.computer) + { + sendSerial("\r"); + } + else + { + // adds a carrot so you know you are talking in terminal + sprintf(strbuf,"\n\r%s>",strMenu); + sendSerial(strbuf); + // sendSerial("\n\r>"); + } } \ No newline at end of file