Uncommenting of part that allow supercaps to charge up from the batteries

Dependencies:   mbed millis

Revision:
28:ae88b18b5cb7
Parent:
26:37450381ffe9
Child:
29:8149eec6d6e7
--- a/main.cpp	Wed Jun 15 10:34:03 2022 +0000
+++ b/main.cpp	Wed Jun 15 11:13:32 2022 +0000
@@ -48,8 +48,8 @@
     motor1.disengage();
 
     //Setting brakes to high
-    brakeValve32 = 0;//(PF_2)
-    brakeValve22 = 0;//(PF_8)
+    brakeValve32 = 0;//(PD_3)
+    brakeValve22 = 0;//(PC_0)
     if (rtc_output.read() == 1) {  //Check RTC pin out
       rtc.getTriggerCause();        // Get RTC input status
     }
@@ -63,7 +63,7 @@
     motor1.throttle(0.0f);
     brakeValve32 = 0;
     brakeValve22 = 0;
-  }
+    inParkMode=true;
   else {//REGEN BRAKING
     if (challenge.regenBrakingActive == true) { // REGEN BRAKING WITH OVERVOLTAGE SAFETY CHECK
       if (brakeRate > 0) {
@@ -77,25 +77,25 @@
     else {  // MECHANICAL BRAKING
       switch (brakeRate) {
         case 0:     // NO BRAKING
-          brakeValve32 = 1;//(PF_2)
-          brakeValve22 = 1;//(PF_8)
+          brakeValve32 = 1;//(PD_3)
+          brakeValve22 = 1;//(PC_0)
           break;
 
         case 1:           //HALF BRAKING
           motor1.throttle(0.0f);
-          brakeValve32 = 0;//(PF_2)
-          brakeValve22 = 1;//(PF_8)
+          brakeValve32 = 0;//(PD_3)
+          brakeValve22 = 1;//(PC_0)
           break;
 
         case 2 ... 4 :    //FULL BRAKING
           motor1.throttle(0.0f);
-          brakeValve32 = 0;//(PF_2)
-          brakeValve22 = 0;//(PF_8)
+          brakeValve32 = 0;//(PD_3)
+          brakeValve22 = 0;//(PC_0)
           break;
 
         default:    // NO BRAKING
-          brakeValve32 = 1;//(PF_2)
-          brakeValve22 = 1;//(PF_8)
+          brakeValve32 = 1;//(PD_3)
+          brakeValve22 = 1;//(PC_0)
           break;
       }
     }
@@ -319,9 +319,10 @@
           motor1.throttle(0);
         }
         ////Park Mode
-        if (driveMode == 2) {                             //place in park mode if selected by driver
+        if (driveMode == 2) {    
+           brakeControl(4);                 //place in park mode if selected by driver, redundancy check 
           if (inParkMode == false) {
-            pc.printf("Train in park mode.\r\n"); //why?
+            //pc.printf("Train in park mode.\r\n"); //why?
           }
 
           if (emergencyStopActive == true && rtc_output.read() == 0) {   // Clear emergency stop flag