Commit 13a51f36 authored by 李俭双's avatar 李俭双

🐞 fix:47628 【天鹰TY200】【胎压换算】胎压换算有点偏差

parent 5b57d322
......@@ -293,13 +293,13 @@ void Data_TPMS_Processing_Service ( void )
TPMS.Front_TPMS_Valid = 0;
TPMS.Rear_TPMS_Valid = 1;
TPMS.Front_Press_Value = 990;
TPMS.Rear_Press_Value = Rear_TPMS * 275;
TPMS.Rear_Press_Value = Rear_TPMS * 2750;
TPMS.Rear_Press_Value /= 102 ;
if(TPMS.Rear_Press_Value > 990)
if(TPMS.Rear_Press_Value > 9900)
{
TPMS.Rear_Press_Value = 990;
TPMS.Rear_Press_Value = 9900;
}
if(((TPMS.Rear_Press_Value + 5)< 170) || ((TPMS.Rear_Press_Value + 5) > 250))
if(((TPMS.Rear_Press_Value + 50)< 1700) || ((TPMS.Rear_Press_Value + 50) > 2500))
{
TPMS.TPMS_Warning = 1;
}
......@@ -313,13 +313,13 @@ void Data_TPMS_Processing_Service ( void )
TPMS.Front_TPMS_Valid = 1;
TPMS.Rear_TPMS_Valid = 0;
TPMS.Rear_Press_Value = 990;
TPMS.Front_Press_Value = Front_TPMS *275 ;
TPMS.Front_Press_Value = Front_TPMS *2750 ;
TPMS.Front_Press_Value /= 102 ;
if(TPMS.Front_Press_Value > 990)
if(TPMS.Front_Press_Value > 9900)
{
TPMS.Front_Press_Value = 990;
TPMS.Front_Press_Value = 9900;
}
if(((TPMS.Front_Press_Value + 5) < 170) || ((TPMS.Front_Press_Value + 5) > 230))
if(((TPMS.Front_Press_Value + 50) < 1700) || ((TPMS.Front_Press_Value + 50) > 2300))
{
TPMS.TPMS_Warning = 1;
}
......@@ -330,8 +330,8 @@ void Data_TPMS_Processing_Service ( void )
}
else
{
TPMS.Front_Press_Value = 990;
TPMS.Rear_Press_Value = 990;
TPMS.Front_Press_Value = 9900;
TPMS.Rear_Press_Value = 9900;
TPMS.TPMS_Warning = 0;
TPMS.Front_TPMS_Valid = 0;
TPMS.Rear_TPMS_Valid = 0;
......@@ -341,20 +341,20 @@ void Data_TPMS_Processing_Service ( void )
{
TPMS.Front_TPMS_Valid = 1;
TPMS.Rear_TPMS_Valid = 1;
TPMS.Front_Press_Value = Front_TPMS * 275 ;
TPMS.Front_Press_Value = Front_TPMS * 2750 ;
TPMS.Front_Press_Value /= 102 ;
if(TPMS.Front_Press_Value > 990)
if(TPMS.Front_Press_Value > 9900)
{
TPMS.Front_Press_Value = 990;
TPMS.Front_Press_Value = 9900;
}
TPMS.Rear_Press_Value = Rear_TPMS * 275;
TPMS.Rear_Press_Value = Rear_TPMS * 2750;
TPMS.Rear_Press_Value /= 102 ;
if(TPMS.Rear_Press_Value > 990)
if(TPMS.Rear_Press_Value > 9900)
{
TPMS.Rear_Press_Value = 990;
TPMS.Rear_Press_Value = 9900;
}
if (((TPMS.Front_Press_Value + 5) < 170) || ((TPMS.Front_Press_Value + 5) > 230) || ((TPMS.Rear_Press_Value + 5) < 170) || ((TPMS.Rear_Press_Value + 5) > 250))
if (((TPMS.Front_Press_Value + 50) < 1700) || ((TPMS.Front_Press_Value + 50) > 2300) || ((TPMS.Rear_Press_Value + 50) < 1700) || ((TPMS.Rear_Press_Value + 50) > 2500))
{
TPMS.TPMS_Warning = 1;
}
......@@ -381,7 +381,7 @@ void Data_TPMS_Processing_Service ( void )
else if(TPMS.TPMS_Front_Learn == LearningFailure)
{
TPMS.TPMS_Front_FirstLearn_Flag = LearningFailure;
TPMS.Front_Press_Value = 990;
TPMS.Front_Press_Value = 9900;
}
else
{
......@@ -404,7 +404,7 @@ void Data_TPMS_Processing_Service ( void )
else if(TPMS.TPMS_Rear_Learn == LearningFailure)
{
TPMS.TPMS_Rear_FirstLearn_Flag = LearningFailure;
TPMS.Rear_Press_Value = 990;
TPMS.Rear_Press_Value = 9900;
}
else
{
......@@ -431,7 +431,7 @@ uint32_t Data_Bar_To_Psi (uint32_t bar)
uint32_t Bar = 0;
Bar = bar * 145;
Bar /= 10;
Bar += 5;
//Bar += 5;
// bar *= 145;
// bar /= 10;
// bar += 5;
......@@ -459,7 +459,7 @@ uint16_t Get_Front_TPMS_Sig_Value (void)
uint16_t value = 0;
if (TPMS.TPMS_Unit == 1)
{
value = (Data_Bar_To_Psi(TPMS.Front_Press_Value) + 50) / 100;
value = (Data_Bar_To_Psi(TPMS.Front_Press_Value) + 500) / 1000;
if(value > 99)
{
value = 99;
......@@ -467,8 +467,8 @@ uint16_t Get_Front_TPMS_Sig_Value (void)
}
else
{
value = TPMS.Front_Press_Value + 5;
value = value / 10;
value = TPMS.Front_Press_Value + 50;
value = value / 100;
}
return value;
}
......@@ -477,7 +477,7 @@ uint16_t Get_Rear_TPMS_Sig_Value (void)
uint16_t value = 0;
if (TPMS.TPMS_Unit == 1)
{
value = (Data_Bar_To_Psi(TPMS.Rear_Press_Value) + 50) / 100;
value = (Data_Bar_To_Psi(TPMS.Rear_Press_Value) + 500) / 1000;
if(value > 99)
{
value = 99;
......@@ -486,15 +486,15 @@ uint16_t Get_Rear_TPMS_Sig_Value (void)
}
else
{
value = TPMS.Rear_Press_Value + 5;
value = value / 10;
value = TPMS.Rear_Press_Value + 50;
value = value / 100;
}
return value;
}
uint16_t Get_Rear_TPMS_TX (void)
{
uint16_t value = 0;
value = Data_Bar_To_Psi(TPMS.Rear_Press_Value) / 10;
value = Data_Bar_To_Psi(TPMS.Rear_Press_Value) / 100;
if(value > 990)
{
value = 990;
......@@ -504,7 +504,7 @@ uint16_t Get_Rear_TPMS_TX (void)
uint16_t Get_Front_TPMS_TX (void)
{
uint16_t value = 0;
value = Data_Bar_To_Psi(TPMS.Front_Press_Value) / 10;
value = Data_Bar_To_Psi(TPMS.Front_Press_Value) / 100;
if(value > 990)
{
value = 990;
......
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