Commit 87aab630 authored by 李俭双's avatar 李俭双

🐞 fix:解决胎压掉线的显示问题

parent af81c159
......@@ -23,6 +23,8 @@ void Data_TPMS_KL30_Init ( void )
TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
TPMS.TPMS_Front_FirstLearn_Flag = MenuData.TPMS_Front_FirstLearn_Flag;
TPMS.TPMS_Rear_FirstLearn_Flag = MenuData.TPMS_Rear_FirstLearn_Flag;
TPMS.TPMS_LOST = 0;
}
void Data_TPMS_KL15_WAKE_UP_Init ( void )
{
......@@ -36,6 +38,8 @@ void Data_TPMS_KL15_WAKE_UP_Init ( void )
TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
TPMS.TPMS_Front_FirstLearn_Flag = MenuData.TPMS_Front_FirstLearn_Flag;
TPMS.TPMS_Rear_FirstLearn_Flag = MenuData.TPMS_Rear_FirstLearn_Flag;
TPMS.TPMS_LOST = 0;
}
void Data_TPMS_Processing_Service ( void )
......@@ -48,11 +52,13 @@ void Data_TPMS_Processing_Service ( void )
{
TPMS.TPMS_Front_Learn = Get_CAN_CH0_ID_341_Sig_Front_LearningStatus();
TPMS.TPMS_Rear_Learn = Get_CAN_CH0_ID_341_Sig_Rear_LearningStatus();
TPMS.TPMS_LOST = 1;
}
else
{
TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
TPMS.TPMS_LOST = 0;
}
......@@ -67,7 +73,15 @@ void Data_TPMS_Processing_Service ( void )
{
if ((MenuData.TPMS_Front_Learn != 0x2) && (MenuData.TPMS_Front_Learn != 0x3) )
{
TPMS.TPMS_Front_Learn = LearningFailure;
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) != CAN_SIG_LOST)
{
TPMS.TPMS_Front_Learn = LearningFailure;
}
else
{
TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
}
}
else
{
......@@ -86,7 +100,14 @@ void Data_TPMS_Processing_Service ( void )
{
if ((MenuData.TPMS_Front_Learn != 0x2) && (MenuData.TPMS_Front_Learn != 0x3) )
{
TPMS.TPMS_Front_Learn = LearningFailure;
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) != CAN_SIG_LOST)
{
TPMS.TPMS_Front_Learn = LearningFailure;
}
else
{
TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
}
}
else
{
......@@ -129,7 +150,14 @@ void Data_TPMS_Processing_Service ( void )
{
if ((MenuData.TPMS_Rear_Learn != 0x2) && (MenuData.TPMS_Rear_Learn != 0x3) )
{
TPMS.TPMS_Rear_Learn = LearningFailure;
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) != CAN_SIG_LOST)
{
TPMS.TPMS_Rear_Learn = LearningFailure;
}
else
{
TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
}
}
else
{
......@@ -148,11 +176,18 @@ void Data_TPMS_Processing_Service ( void )
{
if ((MenuData.TPMS_Rear_Learn != 0x2) && (MenuData.TPMS_Rear_Learn != 0x3) )
{
TPMS.TPMS_Rear_Learn = LearningFailure;
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) != CAN_SIG_LOST)
{
TPMS.TPMS_Rear_Learn = LearningFailure;
}
else
{
TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
}
}
else
{
TPMS.TPMS_Rear_Learn = MenuData.TPMS_Front_Learn;
TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
}
}
}
......@@ -240,7 +275,7 @@ void Data_TPMS_Processing_Service ( void )
{
TPMS.Rear_Press_Value = 990;
}
if((TPMS.Rear_Press_Value < 170) || (TPMS.Rear_Press_Value > 250))
if(((TPMS.Rear_Press_Value + 5)< 170) || ((TPMS.Rear_Press_Value + 5) > 250))
{
TPMS.TPMS_Warning = 1;
}
......@@ -260,7 +295,7 @@ void Data_TPMS_Processing_Service ( void )
{
TPMS.Front_Press_Value = 990;
}
if((TPMS.Front_Press_Value < 170) || (TPMS.Front_Press_Value > 230))
if(((TPMS.Front_Press_Value + 5) < 170) || ((TPMS.Front_Press_Value + 5) > 230))
{
TPMS.TPMS_Warning = 1;
}
......@@ -273,7 +308,7 @@ void Data_TPMS_Processing_Service ( void )
{
TPMS.Front_Press_Value = 990;
TPMS.Rear_Press_Value = 990;
//TPMS.TPMS_Warning = 0;
TPMS.TPMS_Warning = 0;
TPMS.Front_TPMS_Valid = 0;
TPMS.Rear_TPMS_Valid = 0;
}
......@@ -295,7 +330,7 @@ void Data_TPMS_Processing_Service ( void )
{
TPMS.Rear_Press_Value = 990;
}
if ((TPMS.Front_Press_Value < 170) || (TPMS.Front_Press_Value > 230) || (TPMS.Rear_Press_Value < 170) || (TPMS.Rear_Press_Value > 250))
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))
{
TPMS.TPMS_Warning = 1;
}
......@@ -464,3 +499,9 @@ uint8_t Get_Rear_FirstLearn_Flag (void)
return TPMS.TPMS_Rear_FirstLearn_Flag;
}
/*获取0x341是否掉线 0-掉线 “--”闪烁 1-在线 获取学习结果进行显示*/
uint8_t Get_TPMS_CAN_LOST (void)
{
return TPMS.TPMS_LOST ;
}
......@@ -10,6 +10,7 @@ typedef struct __attribute__((aligned(4)))
uint8_t Rear_TPMS_Valid;
uint8_t TPMS_Warning;
uint8_t TPMS_Unit;
uint8_t TPMS_LOST;
uint8_t TPMS_Front_Learn;
uint8_t TPMS_Rear_Learn;
uint8_t TPMS_Front_FirstLearn_Flag;
......@@ -36,4 +37,5 @@ uint16_t Get_Front_TPMS_TX (void);
void Data_TPMS_KL15_WAKE_UP_Init ( void );
uint8_t Get_Front_FirstLearn_Flag (void);
uint8_t Get_Rear_FirstLearn_Flag (void);
uint8_t Get_TPMS_CAN_LOST (void);
#endif
......@@ -2171,8 +2171,59 @@ void SEG_SET_TPMS_DISPLAY(uint8_t m_Flag, uint16_t m_NUM1, uint16_t m_NUM2, uint
IC2_SEG138 = IC_SEG_OFF;
}
}
SEG_SET_FRONT_TPMS_NUM(Get_Front_FirstLearn_Flag(), m_NUM1, m_valid1);
SEG_SET_Rear_TPMS_NUM(Get_Rear_FirstLearn_Flag(), m_NUM2, m_valid2);
if(Get_TPMS_CAN_LOST() == 0)
{
if (FLASH_SYNC_1Hz)
{
IC2_SEG140 = IC_SEG_ON;
IC2_SEG133 = IC_SEG_ON;
IC2_SEG120 = IC_SEG_ON;
IC2_SEG113 = IC_SEG_ON;
}
else
{
IC2_SEG140 = IC_SEG_OFF;
IC2_SEG133 = IC_SEG_OFF;
IC2_SEG120 = IC_SEG_OFF;
IC2_SEG113 = IC_SEG_OFF;
}
IC2_SEG143 = IC_SEG_OFF;
IC2_SEG141 = IC_SEG_OFF;
IC2_SEG139 = IC_SEG_OFF;
IC2_SEG146 = IC_SEG_OFF;
IC2_SEG145 = IC_SEG_OFF;
IC2_SEG144 = IC_SEG_OFF;
IC2_SEG135 = IC_SEG_OFF;
IC2_SEG134 = IC_SEG_OFF;
IC2_SEG132 = IC_SEG_OFF;
IC2_SEG131 = IC_SEG_OFF;
IC2_SEG137 = IC_SEG_OFF;
IC2_SEG136 = IC_SEG_OFF;
IC2_SEG123 = IC_SEG_OFF;
IC2_SEG121 = IC_SEG_OFF;
IC2_SEG119 = IC_SEG_OFF;
IC2_SEG126 = IC_SEG_OFF;
IC2_SEG125 = IC_SEG_OFF;
IC2_SEG124 = IC_SEG_OFF;
IC2_SEG115 = IC_SEG_OFF;
IC2_SEG114 = IC_SEG_OFF;
IC2_SEG112 = IC_SEG_OFF;
IC2_SEG111 = IC_SEG_OFF;
IC2_SEG117 = IC_SEG_OFF;
IC2_SEG116 = IC_SEG_OFF;
}
else
{
SEG_SET_FRONT_TPMS_NUM(Get_Front_FirstLearn_Flag(), m_NUM1, m_valid1);
SEG_SET_Rear_TPMS_NUM(Get_Rear_FirstLearn_Flag(), m_NUM2, m_valid2);
}
}
else
{
......@@ -2231,7 +2282,7 @@ void SEG_SET_FRONT_TPMS_NUM(uint8_t learnflag, uint16_t m_NUM1, uint8_t m_valid1
uint8_t m8;
if (learnflag == 0)
{
if (Get_Current_PageType() == Page_Front_Tpms)
if (Get_Current_PageType() == Page_Front_Tpms)
{
if (FLASH_SYNC_1Hz)
{
......@@ -2301,7 +2352,7 @@ void SEG_SET_FRONT_TPMS_NUM(uint8_t learnflag, uint16_t m_NUM1, uint8_t m_valid1
}
else if (learnflag == 2)
{
if (Get_Current_PageType() == Page_Front_Tpms)
if (Get_Current_PageType() == Page_Front_Tpms)
{
if (FLASH_SYNC_1Hz)
{
......
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