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 workinQM_5thJan_azad by
Diff: EPS.cpp
- Revision:
- 63:55d32e7dcad7
- Parent:
- 57:60e8f00d93c3
- Child:
- 64:241406992336
--- a/EPS.cpp Fri Oct 28 10:02:40 2016 +0000 +++ b/EPS.cpp Fri Oct 28 11:47:20 2016 +0000 @@ -249,27 +249,30 @@ void FCTN_EPS_HANDLE_CDMS_FAULT() { //Variable names from MMS structure, if not, marked as //Temp name - if(CDMS_SW_STATUS == 0b11) //powered on and oc fault + +/*now if this solves the problem then turn it back and observe if it works if doesn't then chane at other places also */ + + if(CDMS_SW_STATUS == 0x03)/*changed to just hex representation see if this solve the purpose->earlier 0b11)*/ //powered on and oc fault if(!CDMS_OC_FAULT) - CDMS_SW_STATUS = 0b01; //powered on and working + CDMS_SW_STATUS = 0x01;//chaged from 0b01; //powered on and working else { - if(CDMS_SW_STATUS == 0b10) //powered off and oc fault + if(CDMS_SW_STATUS == 0x02) //changed 0b10) //powered off and oc fault CDMS_SW_ENABLE = 1; //Temp name if(CDMS_OC_FAULT == 0) { CDMS_FAULT_COUNTER = 0; //Temp name - CDMS_SW_STATUS = 0b01; //powered on and working + CDMS_SW_STATUS = 0x01; //changed->0b01; //powered on and working } else { CDMS_FAULT_COUNTER++; if(CDMS_FAULT_COUNTER == 3) - CDMS_SW_STATUS = 0b11; //powered on and oc fault + CDMS_SW_STATUS = 0x03; //changed->0b11; //powered on and oc fault else { CDMS_SW_ENABLE = 0; //power OFF switch - CDMS_SW_STATUS = 0b10; //powered off and oc fault + CDMS_SW_STATUS = 0x02; //chaged->0b10; //powered off and oc fault } } } @@ -483,7 +486,7 @@ } for(Iteration=0; Iteration<16; Iteration++) { - if(Iteration==14) + if(Iteration==6) //EPS 3.0 in EPS 2.1 it was 14th element actual_data.voltage_actual[Iteration]= (-90.7*3.3*actual_data.voltage_actual[Iteration])+190.1543; else actual_data.voltage_actual[Iteration]= actual_data.voltage_actual[Iteration]*3.3*62/11; @@ -492,10 +495,13 @@ } for(Iteration=0;Iteration<12;Iteration++){ - if(Iteration<8) + if(Iteration<8)// thermistors before in version 2.1 now from12th element but 8-11 are null values only { actual_data.current_actual[Iteration]= actual_data.current_actual[Iteration]*3.3/(50*rsens); - + } + else if(Iteration<12) + { + actual_data.current_actual[Iteration]= 0; } else actual_data.current_actual[Iteration]=actual_data.current_actual[Iteration]*3.3; @@ -817,6 +823,9 @@ bae_HK_minmax.Batt_voltage_min=quant_data.Batt_voltage_quant; bae_HK_minmax.Batt_voltage_max=quant_data.Batt_voltage_quant; + firstCount=false;//just as a precaution see if correct the problem + //printf("/n/r the status is %d",firstCount);/*else during runtime write a printf and see the changes whether it changes or not*/ + } else { for (int i = 0; i < 16; ++i)