|
@@ -93,6 +93,9 @@ void Event_1ms(void)
|
|
|
torsensor_voTorADC();
|
|
|
torsensor_voOffsetUpdate();
|
|
|
|
|
|
+ /* Bike brake info update */
|
|
|
+ bikebrake_voBikeBrakeDetect();
|
|
|
+
|
|
|
/* Torque assist calculation*/
|
|
|
//ass_stCalIn.SOCValue = 100;
|
|
|
ass_stCalIn.SOCValue = MC_RunInfo.SOC;
|
|
@@ -302,7 +305,7 @@ void Event_100ms(void)
|
|
|
bikespeed_stFreGetOut.uwFrequencyPu * (100 - bikespeed_stFreGetCof.uwBikeSpeedLPFGain)) /
|
|
|
100;
|
|
|
/* Bike Throttle Assist */
|
|
|
- if((bikethrottle_stBikeThrottleOut.uwThrottlePercent > 200) && (cp_stBikeRunInfoPara.uwBikeGear > 0) && (cp_stFlg.RunPermitFlg == TRUE))
|
|
|
+ if((bikethrottle_stBikeThrottleOut.uwThrottlePercent > 200) && (cp_stBikeRunInfoPara.uwBikeGear > 0) && (cp_stFlg.RunPermitFlg == TRUE) && (BikeBrake_blGetstate() == FALSE))
|
|
|
{
|
|
|
// signal_state.Sensor = TRUE;
|
|
|
Event_pvt_blBikeThroFlg = TRUE;
|
|
@@ -371,23 +374,23 @@ void Event_200ms(void)
|
|
|
bikespeed_voGetBikeSpeedPwrError(adc_stUpOut.uwU5VPu);
|
|
|
|
|
|
/* Bike Sensor Faults Detect */
|
|
|
-// if((cp_stFlg.RunModelSelect == MountainBIKE) || (cp_stFlg.RunModelSelect == CityBIKE))
|
|
|
-// {
|
|
|
-// alm_stBikeIn.uwTroqReg = torsensor_stTorSensorOut.uwTorqueReg;
|
|
|
-// alm_stBikeIn.uwTroqPu = torsensor_stTorSensorOut.uwTorqueLPFPu;//torsensor_stTorSensorOut.uwTorquePu;
|
|
|
-// alm_stBikeIn.blBikeSpdOvrFlg = bikespeed_stFreGetOut.blBikeSpeedSensorPwrErrorFlg;
|
|
|
-// alm_stBikeIn.blCadenceFreqOvrFlg = cadence_stFreGetOut.blCadenceSensorErrorFlg;
|
|
|
-// alm_stBikeIn.swMotorSpdDir = ass_stCalIn.swDirection;
|
|
|
-// alm_stBikeIn.swMotorSpdPu = scm_stSpdFbkLpf.slY.sw.hi;
|
|
|
-// alm_stBikeIn.uwBikeSpdPu = bikespeed_stFreGetOut.uwFrequencyPu;
|
|
|
-// alm_stBikeIn.uwCadenceFreqPu = cadence_stFreGetOut.uwFrequencyPu;
|
|
|
-// alm_stBikeIn.uwMotorNTCReg = adc_stUpOut.MotorTempReg;
|
|
|
-// alm_stBikeIn.uwPCBNTCReg = adc_stUpOut.PCBTempReg;
|
|
|
-// alm_stBikeIn.uwThrottleReg = adc_stUpOut.uwThrottleReg;
|
|
|
-// alm_stBikeIn.blThrottleExistFlg = FALSE;
|
|
|
-// alm_stBikeIn.blMotorNTCExistFlg = FALSE;
|
|
|
-// alm_voDetec200MS(&alm_stBikeIn, &alm_stDetect200MSCoef);
|
|
|
-// }
|
|
|
+ if((cp_stFlg.RunModelSelect == MountainBIKE) || (cp_stFlg.RunModelSelect == CityBIKE))
|
|
|
+ {
|
|
|
+ alm_stBikeIn.uwTroqReg = torsensor_stTorSensorOut.uwTorqueReg;
|
|
|
+ alm_stBikeIn.uwTroqPu = torsensor_stTorSensorOut.uwTorqueLPFPu;//torsensor_stTorSensorOut.uwTorquePu;
|
|
|
+ alm_stBikeIn.blBikeSpdOvrFlg = bikespeed_stFreGetOut.blBikeSpeedSensorPwrErrorFlg;
|
|
|
+ alm_stBikeIn.blCadenceFreqOvrFlg = cadence_stFreGetOut.blCadenceSensorErrorFlg;
|
|
|
+ alm_stBikeIn.swMotorSpdDir = ass_stCalIn.swDirection;
|
|
|
+ alm_stBikeIn.swMotorSpdPu = scm_stSpdFbkLpf.slY.sw.hi;
|
|
|
+ alm_stBikeIn.uwBikeSpdPu = bikespeed_stFreGetOut.uwFrequencyPu;
|
|
|
+ alm_stBikeIn.uwCadenceFreqPu = cadence_stFreGetOut.uwFrequencyPu;
|
|
|
+ alm_stBikeIn.uwMotorNTCReg = adc_stUpOut.MotorTempReg;
|
|
|
+ alm_stBikeIn.uwPCBNTCReg = adc_stUpOut.PCBTempReg;
|
|
|
+ alm_stBikeIn.uwThrottleReg = adc_stUpOut.uwThrottleReg;
|
|
|
+ alm_stBikeIn.blThrottleExistFlg = FALSE;
|
|
|
+ alm_stBikeIn.blMotorNTCExistFlg = FALSE;
|
|
|
+ alm_voDetec200MS(&alm_stBikeIn, &alm_stDetect200MSCoef);
|
|
|
+ }
|
|
|
|
|
|
if (switch_flg.SysFault_Flag == TRUE)
|
|
|
{
|