Commit d45f49fe authored by 时昊's avatar 时昊

feat:修改平均油耗问题

parent 0fe665f1
......@@ -39,18 +39,18 @@ void CAN_18FEF200_Receive(canlib_uint8_t CopyData [])
g_aveFuel.Flg_18FEF200 = 1;
Data_InsFuel.Flg_18FEF200 = 1;
FuelMeter.Flg_18FEF200 = 1;
Data_Fuel_Consumption_Count_ISR(CopyData);
//Data_Fuel_Consumption_Count_ISR(CopyData);
}
uint32_t InsFuel_Cons = 0;
uint16_t FuelRate = 0;
void Data_Fuel_Consumption_Count_ISR(canlib_uint8_t CopyData [] )//100ms
uint32_t FuelRate_Cons = 0;
uint16_t InsFuelRate = 0;
void Data_Fuel_Consumption_Count_ISR(void)//100ms
{
uint32_t FuelRate_Cons = 0;
uint16_t InsFuelRate = 0;
FuelRate = ((uint16_t)CopyData [1]<< 8u)|CopyData [0];
//FuelRate = ((uint16_t)CopyData [1]<< 8u)|CopyData [0];
FuelRate = Get_CAN_CH0_ID_18FEF200_Sig_EngFuelRate();
if(FuelRate < 0xFFFF)
{
......@@ -83,7 +83,7 @@ void Data_Fuel_Consumption_Count_ISR(canlib_uint8_t CopyData [] )//100ms
if(Fuel_Remainder >= 900)
{
Fuel_Remainder = 0 ;
Fuel_Remainder = 0;
}
FuelRate_Cons++;
}
......@@ -94,7 +94,7 @@ void Data_Fuel_Consumption_Count_ISR(canlib_uint8_t CopyData [] )//100ms
{
if(g_aveFuel.RateSum < 0x7FFFFFFF)
{
g_aveFuel.RateSum += FuelRate_Cons;//add100ms 100p UL
g_aveFuel.RateSum = FuelRate_Cons;//add100ms 100p UL
}
else
{
......@@ -157,7 +157,7 @@ void Data_AvgFuel_Processing_Service (void)
if(g_aveFuel.ValueA > 199)
{
g_aveFuel.ValueA = 199 ;
g_aveFuel.ValueA = 199;
}
g_aveFuel.ValueA_Last = g_aveFuel.ValueA;
}
......
......@@ -61,7 +61,7 @@ uint32_t GET_AvgFuel_ConsOf100msUL_Value(void);
void AvgFuel_ConsOf100msUL_Set(uint16_t FuelCons);
void Data_Fuel_Consumption_Count_ISR(canlib_uint8_t CopyData []);
void Data_Fuel_Consumption_Count_ISR(void);
void Data_AvgFuel_TripA_Clear(void);
......
......@@ -125,7 +125,7 @@ void GET_Data_For_YB(void)
MinAFCPara.Speed = Common_Get_Act_V_Speed();
MinAFCPara.RPM = Get_DispEngineSpeed();
MinAFCPara.CurODO = Mile_Get_Index_Value(MILE_INDEX_ODO)*100;
if(GET_AvgFuel_ConsOf100msUL_Value()>= 65335)
if(GET_AvgFuel_ConsOf100msUL_Value()>= 65535)
{
MinAFCPara.FuleConsume = 65535;
}
......
......@@ -161,6 +161,7 @@ void Sys_Run_Mode_50ms_Tasks_Group(void)
void Sys_Run_Mode_100ms_Tasks_Group(void)
{
Data_Fuel_Consumption_Count_ISR();
TPMS_Tyre_Lost();
LED_Driver_Refresh_Example();
PoMa_Sleep_Delay_Time_Handle();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment