Commit 24f9d12e authored by 陈家乐's avatar 陈家乐

🐞 fix:52964 胎压从学习成功信号改为未学习的信号,2分钟后前轮恢复上一胎压值,后轮没变化,修改胎压学习逻辑

parent 9c0fc974
......@@ -2,8 +2,10 @@
#include "Data_TPMS\Data_TPMS.h"
_TPMS_Display TPMS;
uint32_t LearnTime_Count = 0;
uint32_t LearnTime_Count1 = 0;
uint32_t Front_LearnTime_Count0 = 0;
uint32_t Front_LearnTime_Count1 = 0;
uint32_t Rear_LearnTime_Count0 = 0;
uint32_t Rear_LearnTime_Count1 = 0;
uint8_t Can_341_Flg = 0;
void Data_TPMS_KL30_Init ( void )
{
......@@ -26,8 +28,10 @@ void Data_TPMS_KL30_Init ( void )
TPMS.TPMS_Rear_FirstLearn_Flag = MenuData.TPMS_Rear_FirstLearn_Flag;
TPMS.TPMS_LOST = 0;
LearnTime_Count = 0;//6001;
LearnTime_Count1 = 0;//6001;
Front_LearnTime_Count0 = 0;
Front_LearnTime_Count1 = 0;
Rear_LearnTime_Count0 = 0;
Rear_LearnTime_Count1 = 0;
Can_341_Flg = 0;
}
......@@ -45,10 +49,13 @@ void Data_TPMS_KL15_WAKE_UP_Init ( void )
TPMS.TPMS_Rear_FirstLearn_Flag = MenuData.TPMS_Rear_FirstLearn_Flag;
TPMS.TPMS_LOST = 0;
LearnTime_Count = 0;//6001;
LearnTime_Count1 = 0;//6001;
Can_341_Flg = 0;
Front_LearnTime_Count0 = 0;
Front_LearnTime_Count1 = 0;
Rear_LearnTime_Count0 = 0;
Rear_LearnTime_Count1 = 0;
Can_341_Flg = 0;
}
void Can_341_Receive(void)
......@@ -88,15 +95,25 @@ void Data_TPMS_Processing_Service ( void )
TPMS.TPMS_Rear_ID_Value = 0;
}
if((Get_CAN_CH0_ID_373_Sig_Front_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Front_id() != 0xFFFFFFFF))
{
TPMS.TPMS_Front_ID_Value = 1;
//TPMS.TPMS_Front_Learn = LearningCompletion;
}
else
{
TPMS.TPMS_Front_ID_Value = 0;
}
if((Get_CAN_CH0_ID_373_Sig_Rear_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Rear_id() != 0xFFFFFFFF))
{
TPMS.TPMS_Rear_ID_Value = 1;
}
else
{
TPMS.TPMS_Rear_ID_Value = 0;
}
}
else
{
......@@ -107,20 +124,22 @@ void Data_TPMS_Processing_Service ( void )
if(TPMS.TPMS_Front_Learn == 0x0)
{
if(LearnTime_Count <= 6000)
{
LearnTime_Count++;
TPMS.TPMS_Front_Learn = Unstudied;
//if(TPMS.TPMS_Front_Timeclean == 0)
//{
// LearnTime_Count = 0;
//}
//TPMS.TPMS_Front_Timeclean = 1;
Front_LearnTime_Count1 = 0;
if(Front_LearnTime_Count0 <= 6000)
{
Front_LearnTime_Count0++;
TPMS.TPMS_Front_Learn = Unstudied;
//LearnTime_Count = 0;
}
else
{
if(TPMS.TPMS_Front_Timeclean == 1)
{
LearnTime_Count = 0;
}
TPMS.TPMS_Front_Timeclean = 0;
if ((MenuData.TPMS_Front_Learn != 0x2) && (MenuData.TPMS_Front_Learn != 0x3) )
{
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) != CAN_SIG_LOST)
......@@ -151,14 +170,15 @@ void Data_TPMS_Processing_Service ( void )
// TPMS.TPMS_Front_ID_Value = 0;
//}
if(TPMS.TPMS_Front_Timeclean == 0)
{
LearnTime_Count = 0;
}
TPMS.TPMS_Front_Timeclean = 1;
if(LearnTime_Count <= 6000)
//if(TPMS.TPMS_Front_Timeclean == 0)
//{
// LearnTime_Count = 0;
//}
//TPMS.TPMS_Front_Timeclean = 1;
Front_LearnTime_Count0 = 0;
if(Front_LearnTime_Count1 <= 6000)
{
LearnTime_Count++;
Front_LearnTime_Count1++;
TPMS.TPMS_Front_Learn = Learning;
}
else
......@@ -182,7 +202,8 @@ void Data_TPMS_Processing_Service ( void )
}
else if (TPMS.TPMS_Front_Learn == 0x2)
{
LearnTime_Count = 0;
Front_LearnTime_Count0 = 0;
Front_LearnTime_Count1 = 0;
//if((Get_CAN_CH0_ID_373_Sig_Front_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Front_id() != 0xFFFFFFFF))
//{
// TPMS.TPMS_Front_ID_Value = 1;
......@@ -196,29 +217,34 @@ void Data_TPMS_Processing_Service ( void )
}
else if (TPMS.TPMS_Front_Learn == 0x3)
{
LearnTime_Count = 0;
Front_LearnTime_Count0 = 0;
Front_LearnTime_Count1 = 0;
TPMS.TPMS_Front_Learn = LearningFailure;
}
else
{
LearnTime_Count = 0;
Front_LearnTime_Count0 = 0;
Front_LearnTime_Count1 = 0;
TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
}
if(TPMS.TPMS_Rear_Learn == 0x0)
{
if(LearnTime_Count1 <= 6000)
//if(TPMS.TPMS_Rear_Timeclean == 0)
//{
// LearnTime_Count1 = 0;
//}
//TPMS.TPMS_Rear_Timeclean = 1;
Rear_LearnTime_Count1 = 0;
if(Rear_LearnTime_Count0 <= 6000)
{
LearnTime_Count1++;// = 0;
Rear_LearnTime_Count0++;// = 0;
TPMS.TPMS_Rear_Learn = Unstudied;
}
else
{
if(TPMS.TPMS_Rear_Timeclean == 1)
{
LearnTime_Count1 = 0;
}
TPMS.TPMS_Rear_Timeclean = 0;
if ((MenuData.TPMS_Rear_Learn != 0x2) && (MenuData.TPMS_Rear_Learn != 0x3) )
{
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) != CAN_SIG_LOST)
......@@ -238,15 +264,15 @@ void Data_TPMS_Processing_Service ( void )
}
else if(TPMS.TPMS_Rear_Learn == 0x1)
{
if(TPMS.TPMS_Rear_Timeclean == 0)
{
LearnTime_Count1 = 0;
}
TPMS.TPMS_Rear_Timeclean = 1;
if(LearnTime_Count1 <= 6000)
//if(TPMS.TPMS_Rear_Timeclean == 0)
//{
// LearnTime_Count1 = 0;
//}
//TPMS.TPMS_Rear_Timeclean = 1;
Rear_LearnTime_Count0 = 0;
if(Rear_LearnTime_Count1 <= 6000)
{
LearnTime_Count1++;
Rear_LearnTime_Count1++;
TPMS.TPMS_Rear_Learn = Learning;
}
else
......@@ -271,26 +297,19 @@ void Data_TPMS_Processing_Service ( void )
}
else if (TPMS.TPMS_Rear_Learn == 0x2)
{
LearnTime_Count1 = 0;
if((Get_CAN_CH0_ID_373_Sig_Rear_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Rear_id() != 0xFFFFFFFF))
{
TPMS.TPMS_Rear_ID_Value = 1;
//TPMS.TPMS_Rear_Learn = LearningCompletion;
}
else
{
TPMS.TPMS_Rear_ID_Value = 0;
}
Rear_LearnTime_Count0 = 0;
Rear_LearnTime_Count1 = 0;
}
else if (TPMS.TPMS_Rear_Learn == 0x3)
{
LearnTime_Count1 = 0;
Rear_LearnTime_Count0 = 0;
Rear_LearnTime_Count1 = 0;
TPMS.TPMS_Rear_Learn = LearningFailure;
}
else
{
LearnTime_Count1 = 0;
Rear_LearnTime_Count0 = 0;
Rear_LearnTime_Count1 = 0;
TPMS.TPMS_Rear_Learn = MenuData.TPMS_Front_Learn;
}
......
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