Commit 4a797822 authored by 陈家乐's avatar 陈家乐

🐞 fix:更改燃油状态初始化值,燃油状态检测判断条件

parent f8ad87c1
......@@ -35,7 +35,7 @@ void Fuel_KL30_Init(void)
FuelInitFlag = 1u;
FuelStateInitFlag = 1u;
FuelDir = FUEL_SEG_UP;
FuelSensorState = FuelSensorShortCircuit;//FuelSensorNormal;
FuelSensorState = FuelSensorNormal;//FuelSensorShortCircuit;//FuelSensorNormal;
FuelSensorNormalTime = 0u;
FuelSensorShortTime = 0u;
FuelSensorOpenTime = 0u;
......@@ -51,7 +51,7 @@ void Fuel_KL15_Init(void)
FuelInitFlag = 1u;
FuelStateInitFlag = 1u;
FuelDir = FUEL_SEG_UP;
FuelSensorState = FuelSensorShortCircuit;//FuelSensorNormal;
FuelSensorState = FuelSensorNormal;//FuelSensorShortCircuit;//FuelSensorNormal;
FuelSensorNormalTime = 0u;
FuelSensorShortTime = 0u;
FuelSensorOpenTime = 0u;
......@@ -130,7 +130,7 @@ void Fuel_State_Check(uint8_t deltaTime)
{ /*短路 1*/
FuelSensorOpenTime = 0;
FuelSensorNormalTime = 0;
if ((FuelSensorShortTime > 3000) || ((FuelStateInitFlag) && (FuelSensorShortTime > 3000)))
if ((FuelSensorShortTime > 3000) || ((FuelStateInitFlag) && (FuelSensorShortTime <= 3000)))
{
FuelSensorState = FuelSensorShortCircuit;
DesFuelSetp = 0;
......@@ -148,7 +148,7 @@ void Fuel_State_Check(uint8_t deltaTime)
{ /*断路 320*/
FuelSensorShortTime = 0;
FuelSensorNormalTime = 0;
if ((FuelSensorOpenTime > 2800) || ((FuelStateInitFlag) && (FuelSensorOpenTime > 2800)))
if ((FuelSensorOpenTime > 2800) || ((FuelStateInitFlag) && (FuelSensorOpenTime <= 2800)))
{
FuelSensorState = FuelSensorOpenCircuit;
DesFuelSetp = 0;
......@@ -222,52 +222,57 @@ void Fuel_Gauges_Cal(uint8_t deltaTime)
}
/*计算目标格数*/
if (FuelDir == FUEL_SEG_UP)
if(Common_GetIgnOnTime() > 3005)
{
if (((DesFuelSetp == 4) || FuelInitFlag) && (FuelR < 130))
{
DesFuelSetp = 5;
}
else if (((DesFuelSetp == 3) || FuelInitFlag) && (FuelR < 280))
if (FuelDir == FUEL_SEG_UP)
{
DesFuelSetp = 4;
}
else if (((DesFuelSetp == 2) || FuelInitFlag) && (FuelR < 430))
{
DesFuelSetp = 3;
}
else if (((DesFuelSetp == 1) || FuelInitFlag) && (FuelR < 710))
{
DesFuelSetp = 2;
}
else if (((DesFuelSetp == 0) || FuelInitFlag) && (FuelR < 910))
{
DesFuelSetp = 1;
}
}
else if (FuelDir == FUEL_SEG_DOWN)
{
if (((DesFuelSetp == 1) || FuelInitFlag) && (FuelR >= 910))
{
DesFuelSetp = 0;
}
else if (((DesFuelSetp == 2) || FuelInitFlag) && (FuelR >= 710))
{
DesFuelSetp = 1;
}
else if (((DesFuelSetp == 3) || FuelInitFlag) && (FuelR >= 430))
{
DesFuelSetp = 2;
}
else if (((DesFuelSetp == 4) || FuelInitFlag) && (FuelR >= 280))
{
DesFuelSetp = 3;
if (((DesFuelSetp == 4) || FuelInitFlag) && (FuelR < 130))
{
DesFuelSetp = 5;
}
else if (((DesFuelSetp == 3) || FuelInitFlag) && (FuelR < 280))
{
DesFuelSetp = 4;
}
else if (((DesFuelSetp == 2) || FuelInitFlag) && (FuelR < 430))
{
DesFuelSetp = 3;
}
else if (((DesFuelSetp == 1) || FuelInitFlag) && (FuelR < 710))
{
DesFuelSetp = 2;
}
else if (((DesFuelSetp == 0) || FuelInitFlag) && (FuelR < 910))
{
DesFuelSetp = 1;
}
}
else if (((DesFuelSetp == 5) || FuelInitFlag) && (FuelR >= 130))
else if (FuelDir == FUEL_SEG_DOWN)
{
DesFuelSetp = 4;
if (((DesFuelSetp == 1) || FuelInitFlag) && (FuelR >= 910))
{
DesFuelSetp = 0;
}
else if (((DesFuelSetp == 2) || FuelInitFlag) && (FuelR >= 710))
{
DesFuelSetp = 1;
}
else if (((DesFuelSetp == 3) || FuelInitFlag) && (FuelR >= 430))
{
DesFuelSetp = 2;
}
else if (((DesFuelSetp == 4) || FuelInitFlag) && (FuelR >= 280))
{
DesFuelSetp = 3;
}
else if (((DesFuelSetp == 5) || FuelInitFlag) && (FuelR >= 130))
{
DesFuelSetp = 4;
}
}
}
}
/*IGN ON 1秒/故障恢复后,开始走格 立即指向当前格 20220704*/
......
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