System Management code

Dependencies:   CANBuffer mbed SystemManagement mbed-rtos

Dependents:   SystemManagement

System Management code for Penn Electric Racing

Functions:

Controls Fans and Pumps via instruction from CAN Messages, ramps them up over time to prevent damage

Turns on/off DC-DC converter via instruction from CAN Messages

Revision:
7:5f6e31faa08e
Parent:
6:6a04210a3f4f
--- a/FanPump/FanPump.cpp	Fri Oct 10 20:24:22 2014 +0000
+++ b/FanPump/FanPump.cpp	Fri Oct 10 20:59:36 2014 +0000
@@ -2,14 +2,14 @@
 #include "FanPump.h"
 
 PwmOut pwmPins[PIN_NUM] = { 
-    (P2_0),         // pump
-    (P2_1),         // fan 1
-    (P2_2),         // fan 2
-    (P2_3),         // fan 3
+    PwmOut(P2_0),         // pump
+    PwmOut(P2_1),         // fan 1
+    PwmOut(P2_2),         // fan 2
+    PwmOut(P2_3),         // fan 3
 };
 
 PinStatus pin_status[PIN_NUM];
-CANBuffer *txBuffer;
+CANBuffer *tx_Fan_Buffer;
 
 FanPump::FanPump(CANBuffer *can){
     for(int i = 0; i < PIN_NUM; i++){
@@ -23,7 +23,7 @@
         pin_threads[i] = NULL;
     }  
 
-    txBuffer = can;
+    tx_Fan_Buffer = can;
 }
 
 // this is not a member function. For some reason, thread does weird things
@@ -94,7 +94,7 @@
         }
         
         CANMessage txMessage(TX_FAN_ID, data, 4);
-        txBuffer->txWrite(txMessage);
+        tx_Fan_Buffer->txWrite(txMessage);
         
         Thread::wait(100);  // 10 Hz update    
     }