Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FreescaleIAP mbed-rtos mbed
Fork of RAJANGAM_REVIEW_BAE_CODE by
Diff: EPS.cpp
- Revision:
- 51:661dc022613a
- Parent:
- 50:6001287f3045
- Child:
- 52:daa685b0e390
--- a/EPS.cpp Mon Jul 18 06:36:25 2016 +0000
+++ b/EPS.cpp Fri Jul 22 17:32:41 2016 +0000
@@ -74,7 +74,7 @@
//main
extern uint8_t HTR_CYCLE_COUNTER;
extern uint16_t ACS_MAIN_COUNTER;
-
+extern uint8_t float_to_uint8(float min,float max,float val);
//=======================================================
@@ -499,27 +499,28 @@
actual_data.Batt_voltage_actual=Batt_voltage.read()*3.3*5.63;
- //quantizing data
+ //quantizing data //changing the algo
for(Iteration=0; Iteration<16; Iteration++){
if(Iteration==14)
- quant_data.voltage_quant[Iteration]=quantiz(tstart,tstep,actual_data.voltage_actual[Iteration]);
+ quant_data.voltage_quant[Iteration] = float_to_uint8(0.0,5,actual_data.voltage_actual[Iteration]);//quantiz(tstart,tstep,actual_data.voltage_actual[Iteration]);
else
- quant_data.voltage_quant[Iteration]=quantiz(vstart,vstep,actual_data.voltage_actual[Iteration]);
+ quant_data.voltage_quant[Iteration] = float_to_uint8(0.0,5,actual_data.voltage_actual[Iteration]);//quantiz(vstart,vstep,actual_data.voltage_actual[Iteration]);
}
for(Iteration=0;Iteration<12;Iteration++){
if(Iteration<8)
- quant_data.current_quant[Iteration]=quantiz(cstart,cstep,actual_data.current_actual[Iteration]);
+ quant_data.current_quant[Iteration] = float_to_uint8(0.0,5,actual_data.current_actual[Iteration]);//quantiz(cstart,cstep,actual_data.current_actual[Iteration]);
else
- quant_data.current_quant[Iteration]=quantiz(tstart_thermistor,tstep_thermistor,actual_data.current_actual[Iteration]);
+ quant_data.current_quant[Iteration] = float_to_uint8(0.0,5,actual_data.current_actual[Iteration]);//quantiz(tstart_thermistor,tstep_thermistor,actual_data.current_actual[Iteration]);
}
for(Iteration=0;Iteration<2;Iteration++){
- quant_data.Batt_temp_quant[Iteration]=quantiz(tstart,tstep,actual_data.Batt_temp_actual[Iteration]);
+ quant_data.Batt_temp_quant[Iteration] = float_to_uint8(0.0,5,actual_data.Batt_temp_actual[Iteration]);//quantiz(tstart,tstep,actual_data.Batt_temp_actual[Iteration]);
}
- quant_data.Batt_gauge_quant[0]=quantiz(vcell_start,vcell_step,actual_data.Batt_gauge_actual[0]);
+ //to be changed
+ quant_data.Batt_gauge_quant[0] = quantiz(vcell_start,vcell_step,actual_data.Batt_gauge_actual[0]);
quant_data.Batt_gauge_quant[1]=quantiz(soc_start,soc_step,actual_data.Batt_gauge_actual[1]);
quant_data.Batt_gauge_quant[2]=quantiz(crate_start,crate_step,actual_data.Batt_gauge_actual[2]);
quant_data.Batt_gauge_alerts=actual_data.Batt_gauge_actual[3];
