Treehouse Mbed Team / Mbed 2 deprecated APS_DCM1SL

Dependencies:   mbed

Revision:
3:d8948c5b2951
Parent:
1:9f8583ba2431
Child:
5:09be5bbb5020
--- 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