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 QM_BAE_review_1 by
Diff: EPS.cpp
- Revision:
- 69:c0dd13285d80
- Parent:
- 68:a5d2b8dc6b9e
- Child:
- 70:a2b6c20e2366
--- a/EPS.cpp Sun Dec 04 07:58:20 2016 +0000 +++ b/EPS.cpp Sun Dec 04 12:12:11 2016 +0000 @@ -252,27 +252,27 @@ /*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 = 0x01;//chaged from 0b01; //powered on and working + if(CDMS_SW_STATUS == 0b11)/*changed to just hex representation see if this solve the purpose->earlier 0b11)*/ //powered on and oc fault + if(CDMS_OC_FAULT) // !CDMS_OC_FAULT 0 means badman, 1 means good man // changed + CDMS_SW_STATUS = 0b01;//chaged from 0b01; //powered on and working else { - if(CDMS_SW_STATUS == 0x02) //changed 0b10) //powered off and oc fault + if(CDMS_SW_STATUS == 0b10) //changed 0b10) //powered off and oc fault CDMS_SW_ENABLE = 1; //Temp name - if(CDMS_OC_FAULT == 0) + if(CDMS_OC_FAULT == 1) //changed { CDMS_FAULT_COUNTER = 0; //Temp name - CDMS_SW_STATUS = 0x01; //changed->0b01; //powered on and working + CDMS_SW_STATUS = 0b01; //changed->0b01; //powered on and working } else { CDMS_FAULT_COUNTER++; if(CDMS_FAULT_COUNTER == 3) - CDMS_SW_STATUS = 0x03; //changed->0b11; //powered on and oc fault + CDMS_SW_STATUS = 0b11; //changed->0b11; //powered on and oc fault else { CDMS_SW_ENABLE = 0; //power OFF switch - CDMS_SW_STATUS = 0x02; //chaged->0b10; //powered off and oc fault + CDMS_SW_STATUS = 0b10; //chaged->0b10; //powered off and oc fault } } } @@ -438,9 +438,9 @@ void FCTN_EPS_POWERMODE(float soc) //dummy algo { - if(soc >= EPS_SOC_LEVEL_23*100 ) + if(soc >= EPS_SOC_LEVEL_23 ) actual_data.power_mode = 3; - else if(soc >= EPS_SOC_LEVEL_12*100 ) + else if(soc >= EPS_SOC_LEVEL_12 ) actual_data.power_mode = 2; else actual_data.power_mode = 1; }