Commit 85e3ced7 authored by 李俭双's avatar 李俭双

🐞 fix:43285 更改胎压换算四舍五入的处理

parent e1a42c4d
......@@ -123,10 +123,14 @@ void Data_TPMS_Processing_Service ( void )
}
uint32_t Data_Bar_To_Psi (uint32_t bar)
{
bar *= 145;
bar /= 10;
bar += 5;
return bar;
uint32_t Bar = 0;
Bar = bar * 145;
Bar /= 10;
Bar += 5;
// bar *= 145;
// bar /= 10;
// bar += 5;
return Bar;
}
uint8_t Get_Led_TPMS_Waring (void)
{
......@@ -146,7 +150,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) / 100;
value = (Data_Bar_To_Psi(TPMS.Front_Press_Value) + 50) / 100;
if(value > 99)
{
value = 99;
......@@ -164,7 +168,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) / 100;
value = (Data_Bar_To_Psi(TPMS.Rear_Press_Value) + 50) / 100;
if(value > 99)
{
value = 99;
......
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