Treehouse Mbed Team / Mbed 2 deprecated APS_DCM1SL2

Dependencies:   mbed

Revision:
9:816b9a4e4f21
Parent:
8:d3d7dca419b3
Child:
10:6c3233b03658
--- a/src/command.cpp	Thu Dec 06 16:22:11 2018 +0000
+++ b/src/command.cpp	Fri Dec 07 00:15:19 2018 +0000
@@ -1434,7 +1434,12 @@
       // Skip over any white space and the optional '[' character
       while ((isspace(rxbuf[bufloc])) || (rxbuf[bufloc] == '[')) bufloc++;
       
-      if (rxbuf[bufloc] == '0')
+      if(rxbuf[bufloc] == NULL){
+         boardsActive = 1;
+         startConverter(boardsActive);
+      }
+      else if (rxbuf[bufloc] == '0')
+      //if (rxbuf[bufloc] == '0')
       {
          stopConverter();
          //setDacsToZeroVolts();
@@ -1442,13 +1447,13 @@
       else if ((rxbuf[bufloc] > '0') && (rxbuf[bufloc] < '0' + MAX_BOARDS))
       {
          ival = atoi(&rxbuf[bufloc]);
-         ival--;
+         //ival--;
          
          if (running == 0)
          {
             //setDacsToZeroVolts();
             //Delay(1000);
-            wait(0.5);
+            //wait(0.5);
             boardsActive = ival;
             startConverter(boardsActive);
          }
@@ -1471,7 +1476,7 @@
       }
       else
       {
-         sprintf(strbuf, " Invalid register number (1 - %d)", MAX_BOARDS);
+         sprintf(strbuf, " Invalid number of boards (1 - %d)", MAX_BOARDS);
          sendSerial(strbuf);
          commandError = 1;
       }
@@ -1876,6 +1881,8 @@
    
    serialStatus.computer = FALSE;
    serialStatus.command  = FALSE;
+   
+   //sendSerial("didCommand\r\n");
 }
 
 /************************************************************