PWM and ALGO updated.. PWM getting generated

Dependencies:   FreescaleIAP mbed-rtos mbed

Fork of TFR_BAE_vr1_1working_finally_PWM_update by Team Fox

Revision:
5:bb592f3185cc
Parent:
4:39a4ae8c7ecd
--- a/EPS.h	Wed Dec 30 04:57:46 2015 +0000
+++ b/EPS.h	Thu Dec 31 17:12:52 2015 +0000
@@ -42,12 +42,15 @@
 //#define VBATT PIN20
 #define BATT_HEAT PIN96
 //#define BATT_HEAT_OUTPUT 
+extern void FCTN_CONVERT_FLOAT(float input, uint8_t* output);
+
 void FCTN_EPS_INIT();
 
 void FCTN_EPS_POWERMODE(float soc) ;
 
 void FCTN_HK_MAIN();
-int quantiz(float start,float step,float x);
+void FCTN_APPEND_HKDATA();
+uint8_t quantiz(float start,float step,float x);
 
 void saveMin();
 void saveMax();
@@ -90,32 +93,37 @@
     float Batt_gauge_actual[4];
     float BAE_temp_actual;
     char power_mode;      
-    char fault_status;         
+    uint8_t faultPoll_status; 
+    uint8_t faultIr_status;
     float AngularSpeed_actual[3];   
     float Bvalue_actual[3];
     float Batt_voltage_actual;   
+   
 }BAE_HK_actual;
 
 typedef struct BAE_HK_quant{
-    char voltage_quant[16];      //power_mode should be appended to sd card 
-    char current_quant[12];
-    char Batt_temp_quant[2];
-    char Batt_gauge_quant[3];
+    uint8_t voltage_quant[16];      //power_mode + faults should be appended to sd card 
+    uint8_t current_quant[12];
+    uint8_t Batt_temp_quant[2];
+    uint8_t Batt_gauge_quant[3];       // why only 3 here??
     float Batt_gauge_alerts;
-    char BAE_temp_quant;
-    char AngularSpeed_quant[3];   
+    uint8_t BAE_temp_quant;
+    float AngularSpeed_quant[3];   
     float Bvalue_quant[3];  
-    char Batt_voltage_quant;  
+    uint8_t Batt_voltage_quant;  
 }BAE_HK_quant;
 
-typedef struct BAE_HK_arch{
+typedef struct BAE_HK_arch{         //power_mode + faults should be appended to sd card 
     
-    char Batt_1_temp;
-    char Batt_2_temp;
-    char EPS_PCB_temp;
-    char Batt_SOC;
+    uint8_t Batt_1_temp;            //verify if uint8_t is right
+    uint8_t Batt_2_temp; 
+    uint8_t EPS_PCB_temp;
+    uint8_t Batt_SOC;           
     char power_mode;
-    char Batt_voltage;
+    uint8_t faultPoll_status; 
+    uint8_t faultIr_status;
+    uint8_t Batt_voltage;
+    
     //char Batt_voltage2;
     // char Digital power bus voltage;
     
@@ -123,23 +131,23 @@
 }BAE_HK_arch;
 
 typedef struct BAE_HK_min_max{
-    char voltage_max[16];
-    char current_max[12];
-    char Batt_temp_max[2];
-    char Batt_gauge_max[3];
-    char BAE_temp_max;    
-    char AngularSpeed_max[3];   
+    uint8_t voltage_max[16];
+    uint8_t current_max[12];
+    uint8_t Batt_temp_max[2];
+    uint8_t Batt_gauge_max[3];
+    uint8_t BAE_temp_max;    
+    float AngularSpeed_max[3];   
     float Bvalue_max[3];    
-    char Batt_voltage_max;  
+    uint8_t Batt_voltage_max;  
 
-    char voltage_min[16];
-    char current_min[12];
-    char Batt_temp_min[2];
-    char Batt_gauge_min[3];
-    char BAE_temp_min;
-    char AngularSpeed_min[3];   
+    uint8_t voltage_min[16];
+    uint8_t current_min[12];
+    uint8_t Batt_temp_min[2];
+    uint8_t Batt_gauge_min[3];
+    uint8_t BAE_temp_min;
+    float AngularSpeed_min[3];   
     float Bvalue_min[3];    
-    char Batt_voltage_min;  
+    uint8_t Batt_voltage_min;  
 
 }BAE_HK_min_max;