|
@@ -61,7 +61,10 @@ void HAL_SYSTICK_Callback(void)
|
|
|
}
|
|
|
|
|
|
//更新指拨零点值
|
|
|
- GasSensorOffSetData_Update(&GasSensor_OffSet, ADC1_Result[ADC1_RANK_GAS], &MC_ErrorCode);
|
|
|
+ if(IsGasSensorConnectedFlag == TRUE)
|
|
|
+ {
|
|
|
+ GasSensorOffSetData_Update(&GasSensor_OffSet, ADC1_Result[ADC1_RANK_GAS], &MC_ErrorCode);
|
|
|
+ }
|
|
|
|
|
|
//ADC数据滑动滤波计算
|
|
|
ADC_SensorData_Filt(ADC1_Result_Filt, ADC2_Result_Filt);
|
|
@@ -137,8 +140,7 @@ void MC_RunInfo_Update(void)
|
|
|
PeriodTimeCnt = HAL_GetTick();
|
|
|
|
|
|
//计算电功率
|
|
|
-// MC_RunInfo.Power = (uint16_t)((uint32_t)(MC_RunInfo.BusCurrent / 100 * MC_RunInfo.BusVoltage / 100) / 100) / 2;
|
|
|
- MC_RunInfo.Power = ((uint32_t)MC_RunInfo.BusCurrent) * 25 / (MC_ConfigParam1.CurrentLimit*100);
|
|
|
+ MC_RunInfo.Power = ((uint32_t)MC_RunInfo.BusCurrent) * 25 / (MC_ConfigParam1.CurrentLimit * 100);
|
|
|
MC_RunInfo.Power = (MC_RunInfo.Power < 20) ? 0 : MC_RunInfo.Power;
|
|
|
|
|
|
//更新踏频方向
|
|
@@ -154,7 +156,7 @@ void MC_RunInfo_Update(void)
|
|
|
MC_RunInfo.LightSwitch = MC_ControlCode.LightSwitch;
|
|
|
|
|
|
//剩余电量
|
|
|
- MC_RunInfo.SOC = (DeviceOnLine_Status.Status_Bit.BMS_OffLine == 1) ? Battery_SocCal(MC_RunInfo.BusVoltage * 36 / MC_MotorParam.Rate_Voltage, MC_RunInfo.BusCurrent)
|
|
|
+ MC_RunInfo.SOC = (DeviceOnLine_Status.Status_Bit.BMS_OffLine == 1) ? Battery_SocCal(MC_RunInfo.BusVoltage * 36 / MC_MotorParam.Rate_Voltage)
|
|
|
: BMS_RunInfo.SOC;
|
|
|
//续航里程
|
|
|
MC_RunInfo.RemainDistance = (DeviceOnLine_Status.Status_Bit.BMS_OffLine == 1) ? 0xEEEE : RemainDis.remainDistance;
|
|
@@ -724,7 +726,7 @@ void MC_DeviceCheck(Device_CheckInfo_Struct_t* p_Device, MC_ErrorCode_Struct_t*
|
|
|
}
|
|
|
case 2://校验按键
|
|
|
{
|
|
|
- p_ErrorCode->ERROR_Bit.Fault_BMS_Check = 1;
|
|
|
+ p_ErrorCode->ERROR_Bit.Fault_PBU_Check = 1;
|
|
|
Send_CanID = ID_MC_TO_BMS;
|
|
|
Send_MAC_ID_Cmd = 0x5100;
|
|
|
Send_Code_Cmd = 0x5200;
|
|
@@ -732,7 +734,7 @@ void MC_DeviceCheck(Device_CheckInfo_Struct_t* p_Device, MC_ErrorCode_Struct_t*
|
|
|
}
|
|
|
case 3://校验仪表
|
|
|
{
|
|
|
- p_ErrorCode->ERROR_Bit.Fault_BMS_Check = 1;
|
|
|
+ p_ErrorCode->ERROR_Bit.Fault_HMI_Check = 1;
|
|
|
Send_CanID = ID_MC_TO_BMS;
|
|
|
Send_MAC_ID_Cmd = 0x7100;
|
|
|
Send_Code_Cmd = 0x7200;
|