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

Dependencies:   mbed millis

Revision:
6:d0ba4c659e9c
Parent:
5:1911475688a8
Child:
8:0fe9f7bde2f9
--- a/main.cpp	Wed Apr 13 08:57:28 2022 +0000
+++ b/main.cpp	Wed Apr 13 12:39:00 2022 +0000
@@ -67,20 +67,25 @@
     }
 }
 
-void emergencyStop() {
+void emergencyStop()  {    //Emergency Stop Function
 //    pc.printf("Emergency Stop Active\r\n");
     if (emergencyStopActive == false) {
         
         emergencyStopActive = true;
                 
-        motor1.disengage();     // Disengage both motors
+        motor1.disengage();
+        
+        //Setting brakes to high
+         brakeValve32 = 0;//(PF_2)
+         brakeValve22 = 0;//(PG_1)
+             // Disengage both motors
 //        motor2.disengage();
         
-        motor1.setPark();       // Clear Motor Directions
+    //    motor1.setPark(); Redundancy as disengage function simply calls SetPark      // Clear Motor Directions
 //        motor2.setPark();
         
-        if (rtc_output.read() == 1) {
-            rtc.getTriggerCause();        // Get RTC input status
+        if (rtc_output.read() == 1) {  //Check RTC pin out
+            rtc.getTriggerCause();        // Get RTC input status 
         }
     }
 }
@@ -518,7 +523,7 @@
 //                    pc.printf("ParkMode = %d", inParkMode);
                     
                     if (inParkMode == false) {
-                        pc.printf("Train in park mode.\r\n");
+                        pc.printf("Train in park mode.\r\n"); //why?
                     }
                     
                     if (emergencyStopActive == true && rtc_output.read() == 0) {   // Clear emergency stop flag