Treehouse Mbed Team / Mbed 2 deprecated APS_1U5x

Dependencies:   mbed

Revision:
8:d3d7dca419b3
Parent:
7:860b3a8275cb
Child:
9:816b9a4e4f21
--- a/src/main.cpp	Wed Dec 05 00:20:34 2018 +0000
+++ b/src/main.cpp	Thu Dec 06 16:22:11 2018 +0000
@@ -36,11 +36,12 @@
 #include "adc.h"
 #include "menu.h"
 #include "boards.h"
+#include "command.h"
 
 unsigned int boardsActive;
 unsigned int boardMults;
-unsigned short v48, v24, v12; // Voltage divide ratio is a little low due to substituting 10k resistors in place of the 100k. The 100k caused the opamps to oscillate.
-unsigned short i48, i24, i12;
+unsigned int v48, v24, v12; // Voltage divide ratio is a little low due to substituting 10k resistors in place of the 100k. The 100k caused the opamps to oscillate.
+unsigned int i48, i24, i12;
 unsigned int binCode[6];
 unsigned int en_out_code;
 unsigned int thermCode[17];
@@ -50,6 +51,7 @@
 unsigned int updateRefreshTicks=0;
 volatile bool updateReady = FALSE;
 unsigned int loopTime = 0;
+bool raw = FALSE;
 
 Timer masterTimer;
 
@@ -64,26 +66,34 @@
    en_out_code = setBoardWeights(ALLOFF); // RK: Maybe? Use hex value for boardWeights to highlight that it's an encoded value.
     
    initSerial();
-   sprintf(strbuf, "\r\nAgility Power Systems DCM1 Rev 0.35");
-   sendSerial(strbuf);
+   
    //sendCRLF();
-   menuPrompt(MENU_DCM1);
+   //menuPrompt(MENU_DCM1);
     
    initDRT(); // Display Refresh Timer
    
    initADC();
-   getADCvolts();
-   getADCamps();
-   menuRedraw();
+   //getADCvolts();
+   //getADCamps();
+   getADCresults();
    
-   masterTimer.start();
+   splash_screen();
+   sprintf(strbuf, "\r\nPress Enter to continue");
+   sendSerial(strbuf);
+   while(waitCommand()){
+   }
+   
+   menuRedraw(WITH_PROMPT);
+   
+   //masterTimer.start();
   
    while (1)
    {
       processCommand();
       
-      getADCvolts();
-      getADCamps();
+      //getADCvolts();
+      //getADCamps();
+      getADCresults();
       
       if(updateReady){
          updateReady = FALSE;