Commit 04ad070f authored by 李俭双's avatar 李俭双

🐞 fix:43688 【倩鹰TY100γ€‘γ€θƒŽεŽ‹ε€–ε‘γ€‘θƒŽεŽ‹ε€–ε‘ε€§εŠζ˜Ύη€Ίι”™θ――

parent 82041e3c
...@@ -95,7 +95,10 @@ void Can_Set_Buff_450(canlib_uint8_t CopyData[]) ...@@ -95,7 +95,10 @@ void Can_Set_Buff_450(canlib_uint8_t CopyData[])
p450->Msg [ i ] = 0xFFu; p450->Msg [ i ] = 0xFFu;
} }
} }
p450 -> Sig.Front_Pressure_TX = Get_Front_TPMS_TX(); p450 -> Sig.Front_Pressure_TX_H = (Get_Front_TPMS_TX() >> 8) & 0xFF;
p450 -> Sig.Rear_Pressure_TX = Get_Rear_TPMS_TX(); p450 -> Sig.Front_Pressure_TX_L = Get_Front_TPMS_TX() & 0xFF;
p450 -> Sig.Rear_Pressure_TX_H = (Get_Rear_TPMS_TX() >> 8) & 0xFF;
p450 -> Sig.Rear_Pressure_TX_L = Get_Rear_TPMS_TX() & 0xFF;
} }
...@@ -72,10 +72,10 @@ typedef union ...@@ -72,10 +72,10 @@ typedef union
uint8_t Msg [ 8 ]; uint8_t Msg [ 8 ];
struct struct
{ {
uint32_t Front_Pressure_TX : 16; uint16_t Front_Pressure_TX_H : 8;
uint16_t Front_Pressure_TX_L : 8;
uint32_t Rear_Pressure_TX : 16; uint16_t Rear_Pressure_TX_H : 8;
uint16_t Rear_Pressure_TX_L : 8;
//uint32_t Front_Air_Leakage_TX : 1; //uint32_t Front_Air_Leakage_TX : 1;
//uint32_t Rear_Air_Leakage_TX : 1; //uint32_t Rear_Air_Leakage_TX : 1;
//uint32_t Front_Low_Voltage_TX : 1; //uint32_t Front_Low_Voltage_TX : 1;
......
...@@ -38,7 +38,7 @@ void Data_TPMS_Processing_Service ( void ) ...@@ -38,7 +38,7 @@ void Data_TPMS_Processing_Service ( void )
{ {
TPMS.Front_TPMS_Valid = 0; TPMS.Front_TPMS_Valid = 0;
TPMS.Rear_TPMS_Valid = 1; TPMS.Rear_TPMS_Valid = 1;
TPMS.Front_Press_Value = 99; TPMS.Front_Press_Value = 990;
TPMS.Rear_Press_Value = Rear_TPMS * 275; TPMS.Rear_Press_Value = Rear_TPMS * 275;
TPMS.Rear_Press_Value /= 102 ; TPMS.Rear_Press_Value /= 102 ;
if(TPMS.Rear_Press_Value > 990) if(TPMS.Rear_Press_Value > 990)
...@@ -54,11 +54,11 @@ void Data_TPMS_Processing_Service ( void ) ...@@ -54,11 +54,11 @@ void Data_TPMS_Processing_Service ( void )
TPMS.TPMS_Warning = 0; TPMS.TPMS_Warning = 0;
} }
} }
else if ((Front_TPMS != 0xFF) || (Rear_TPMS == 0xFF)) else if ((Front_TPMS != 0xFF) && (Rear_TPMS == 0xFF))
{ {
TPMS.Front_TPMS_Valid = 1; TPMS.Front_TPMS_Valid = 1;
TPMS.Rear_TPMS_Valid = 0; TPMS.Rear_TPMS_Valid = 0;
TPMS.Rear_Press_Value = 99; TPMS.Rear_Press_Value = 990;
TPMS.Front_Press_Value = Front_TPMS *275 ; TPMS.Front_Press_Value = Front_TPMS *275 ;
TPMS.Front_Press_Value /= 102 ; TPMS.Front_Press_Value /= 102 ;
if(TPMS.Front_Press_Value > 990) if(TPMS.Front_Press_Value > 990)
...@@ -121,7 +121,7 @@ void Data_TPMS_Processing_Service ( void ) ...@@ -121,7 +121,7 @@ void Data_TPMS_Processing_Service ( void )
TPMS.TPMS_Warning = 0; TPMS.TPMS_Warning = 0;
} }
} }
uint16_t Data_Bar_To_Psi (uint16_t bar) uint32_t Data_Bar_To_Psi (uint32_t bar)
{ {
bar *= 145; bar *= 145;
bar /= 10; bar /= 10;
...@@ -154,8 +154,8 @@ uint16_t Get_Front_TPMS_Sig_Value (void) ...@@ -154,8 +154,8 @@ uint16_t Get_Front_TPMS_Sig_Value (void)
} }
else else
{ {
TPMS.Front_Press_Value += 5; value = TPMS.Front_Press_Value + 5;
value = TPMS.Front_Press_Value / 10; value = value / 10;
} }
return value; return value;
} }
...@@ -173,16 +173,28 @@ uint16_t Get_Rear_TPMS_Sig_Value (void) ...@@ -173,16 +173,28 @@ uint16_t Get_Rear_TPMS_Sig_Value (void)
} }
else else
{ {
TPMS.Rear_Press_Value += 5; value = TPMS.Rear_Press_Value + 5;
value = TPMS.Rear_Press_Value / 10; value = value / 10;
} }
return value; return value;
} }
uint16_t Get_Rear_TPMS_TX (void) uint16_t Get_Rear_TPMS_TX (void)
{ {
return TPMS.Rear_Press_Value; uint16_t value = 0;
value = Data_Bar_To_Psi(TPMS.Rear_Press_Value) / 10;
if(value > 990)
{
value = 990;
}
return value;
} }
uint16_t Get_Front_TPMS_TX (void) uint16_t Get_Front_TPMS_TX (void)
{ {
return TPMS.Front_Press_Value; uint16_t value = 0;
value = Data_Bar_To_Psi(TPMS.Front_Press_Value) / 10;
if(value > 990)
{
value = 990;
}
return value;
} }
\ No newline at end of file
...@@ -14,7 +14,7 @@ typedef struct ...@@ -14,7 +14,7 @@ typedef struct
}_TPMS_Display; }_TPMS_Display;
void Data_TPMS_KL30_Init ( void ); void Data_TPMS_KL30_Init ( void );
void Data_TPMS_Processing_Service ( void ); void Data_TPMS_Processing_Service ( void );
uint16_t Data_Bar_To_Psi (uint16_t bar); uint32_t Data_Bar_To_Psi (uint32_t bar);
uint8_t Get_Led_TPMS_Waring (void); uint8_t Get_Led_TPMS_Waring (void);
uint8_t Get_Front_TPMS_Sig_Vaild (void); uint8_t Get_Front_TPMS_Sig_Vaild (void);
uint8_t Get_Rear_TPMS_Sig_Vaild (void); uint8_t Get_Rear_TPMS_Sig_Vaild (void);
......
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