Commit bcd73fec authored by 李俭双's avatar 李俭双

Merge branch 'CHENJIALE' into 'dev'

Chenjiale

See merge request !52
parents 0f5b4501 be367a83
......@@ -36,7 +36,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
1000ul,
0x341ul,
(( void * )0),
(( void * )0),
(Can_341_Receive),
(( void * )0),
},
{
......
......@@ -157,7 +157,7 @@ void Can_Set_Buff_580(canlib_uint8_t CopyData[])
if(Get_Tpms_TX_Flag() == 1)
{
if(++CAN_TX_Count >= 3)
if(++CAN_TX_Count > 3)
{
Tpms_TX_Flag = 0;
CAN_TX_Count = 0;
......@@ -170,7 +170,7 @@ void Can_Set_Buff_580(canlib_uint8_t CopyData[])
}
else if(Get_Tpms_TX_Flag() == 2)
{
if(++CAN_TX_Count >= 3)
if(++CAN_TX_Count > 3)
{
Tpms_TX_Flag = 0;
CAN_TX_Count = 0;
......@@ -184,11 +184,11 @@ void Can_Set_Buff_580(canlib_uint8_t CopyData[])
else
{
CAN_TX_Count = 0;
p580 -> Sig.TPMS_LEARN_CND_BYTE0 = 0x0;
p580 -> Sig.TPMS_LEARN_CND_BYTE1 = 0x0;
p580 -> Sig.TPMS_LEARN_CND_BYTE2 = 0x0;
p580 -> Sig.TPMS_LEARN_CND_BYTE3 = 0x0;
p580 -> Sig.TPMS_LEARN_CND_BYTE4 = 0x02;
//p580 -> Sig.TPMS_LEARN_CND_BYTE0 = 0x0;
//p580 -> Sig.TPMS_LEARN_CND_BYTE1 = 0x0;
//p580 -> Sig.TPMS_LEARN_CND_BYTE2 = 0x0;
//p580 -> Sig.TPMS_LEARN_CND_BYTE3 = 0x0;
//p580 -> Sig.TPMS_LEARN_CND_BYTE4 = 0x02;
}
}
......
......@@ -307,7 +307,7 @@ uint8_t Get_Busoff_Status(void)
{
return get_can_busoff(CAN_CH_0);
}
extern uint8_t Can_341_Flg;
uint8_t COM_APP_Process(st_CAN_Msg *Msg)
{
// Can_Write((st_CAN_Msg *)Msg);
......@@ -340,14 +340,23 @@ uint8_t COM_APP_Process(st_CAN_Msg *Msg)
CAN_result = CAN_Transmit(CAN0MSG12, &CAN_SendMsg);
break;
case 0x450:
if(Can_341_Flg == 1 || Common_GetIgnOnTime() > 2000)
{
CAN_result = CAN_Transmit(CAN0MSG13, &CAN_SendMsg);
}
break;
case 0x220:
CAN_result = CAN_Transmit(CAN0MSG10, &CAN_SendMsg);
break;
#if (IC_Current == TY200_080000b_ty)
case 0x580:
if(Get_Tpms_TX_Flag() == 1 || Get_Tpms_TX_Flag() == 2)
{
CAN_result = CAN_Transmit(CAN0MSG14, &CAN_SendMsg);
}
break;
#endif
default:
......
......@@ -4,6 +4,7 @@
_TPMS_Display TPMS;
uint32_t LearnTime_Count = 0;
uint32_t LearnTime_Count1 = 0;
uint8_t Can_341_Flg = 0;
void Data_TPMS_KL30_Init ( void )
{
uint8_t TPMS_L[2] = {0,0};
......@@ -27,6 +28,8 @@ void Data_TPMS_KL30_Init ( void )
TPMS.TPMS_LOST = 0;
LearnTime_Count = 6001;
LearnTime_Count1 = 6001;
Can_341_Flg = 0;
}
void Data_TPMS_KL15_WAKE_UP_Init ( void )
{
......@@ -44,6 +47,13 @@ void Data_TPMS_KL15_WAKE_UP_Init ( void )
TPMS.TPMS_LOST = 0;
LearnTime_Count = 6001;
LearnTime_Count1 = 6001;
Can_341_Flg = 0;
}
void Can_341_Receive(void)
{
Can_341_Flg = 1;
}
void Data_TPMS_Processing_Service ( void )
......@@ -68,44 +78,45 @@ void Data_TPMS_Processing_Service ( void )
if(TPMS.TPMS_Front_Learn == 0x0)
{
//if(LearnTime_Count <= 6000)
//{
// LearnTime_Count++;
if(LearnTime_Count <= 6000)
{
LearnTime_Count++;
TPMS.TPMS_Front_Learn = Unstudied;
//LearnTime_Count = 0;
}
else
{
if(TPMS.TPMS_Front_Timeclean == 1)
{
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)
// {
// TPMS.TPMS_Front_Learn = LearningFailure;
// }
// else
// {
// TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
// }
//
// }
// else
// {
// TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
// }
//}
}
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)
{
TPMS.TPMS_Front_Learn = LearningFailure;
}
else
{
TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
}
}
else
{
TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
}
}
}
else if(TPMS.TPMS_Front_Learn == 0x1)
{
//if(TPMS.TPMS_Front_Timeclean == 0)
//{
// LearnTime_Count = 0;
//}
//TPMS.TPMS_Front_Timeclean = 1;
if(TPMS.TPMS_Front_Timeclean == 0)
{
LearnTime_Count = 0;
}
TPMS.TPMS_Front_Timeclean = 1;
if(LearnTime_Count <= 6000)
{
LearnTime_Count++;
......@@ -135,11 +146,12 @@ void Data_TPMS_Processing_Service ( void )
LearnTime_Count = 0;
if((Get_CAN_CH0_ID_373_Sig_Front_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Front_id() != 0xFFFFFFFF))
{
TPMS.TPMS_Front_Learn = LearningCompletion;
TPMS.TPMS_Front_ID_Value = 1;
//TPMS.TPMS_Front_Learn = LearningCompletion;
}
else
{
;
TPMS.TPMS_Front_ID_Value = 0;
}
}
......@@ -156,34 +168,34 @@ void Data_TPMS_Processing_Service ( void )
if(TPMS.TPMS_Rear_Learn == 0x0)
{
//if(LearnTime_Count1 <= 6000)
//{
if(LearnTime_Count1 <= 6000)
{
LearnTime_Count1 = 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)
// {
// TPMS.TPMS_Rear_Learn = LearningFailure;
// }
// else
// {
// TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
// }
// }
// else
// {
// TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
// }
//}
}
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)
{
TPMS.TPMS_Rear_Learn = LearningFailure;
}
else
{
TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
}
}
else
{
TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
}
}
}
else if(TPMS.TPMS_Rear_Learn == 0x1)
{
......@@ -221,11 +233,12 @@ void Data_TPMS_Processing_Service ( void )
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_Learn = LearningCompletion;
TPMS.TPMS_Rear_ID_Value = 1;
//TPMS.TPMS_Rear_Learn = LearningCompletion;
}
else
{
;
TPMS.TPMS_Rear_ID_Value = 0;
}
}
......@@ -461,6 +474,15 @@ uint8_t Get_Rear_TPMS_Sig_Vaild (void)
{
return TPMS.Rear_TPMS_Valid;
}
uint8_t Get_Front_TPMS_ID_Vaild (void)
{
return TPMS.TPMS_Front_ID_Value;
}
uint8_t Get_Rear_TPMS_ID_Vaild (void)
{
return TPMS.TPMS_Rear_ID_Value;
}
//10倍
uint16_t Get_Front_TPMS_Sig_Value (void)
{
......
......@@ -19,6 +19,9 @@ typedef struct __attribute__((aligned(4)))
uint8_t TPMS_Front_Timeclean;
uint8_t TPMS_Rear_Timeclean;
uint8_t TPMS_Front_ID_Value;
uint8_t TPMS_Rear_ID_Value;
}_TPMS_Display;
typedef enum
{
......@@ -33,6 +36,8 @@ uint32_t Data_Bar_To_Psi (uint32_t bar);
uint8_t Get_Led_TPMS_Waring (void);
uint8_t Get_Front_TPMS_Sig_Vaild (void);
uint8_t Get_Rear_TPMS_Sig_Vaild (void);
uint8_t Get_Front_TPMS_ID_Vaild (void);
uint8_t Get_Rear_TPMS_ID_Vaild (void);
uint16_t Get_Front_TPMS_Sig_Value (void);
uint16_t Get_Rear_TPMS_Sig_Value (void);
uint16_t Get_Rear_TPMS_TX (void);
......@@ -41,4 +46,6 @@ 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);
void Can_341_Receive(void);
#endif
......@@ -1090,8 +1090,8 @@ void SEG_SET_FuelDial(uint8_t m_Flag, uint8_t m_SEG)
IC2_SEG102 = IC_SEG_GREY;
IC2_SEG101 = IC_SEG_GREY;
IC2_SEG108 = IC_SEG_GREY;
IC2_SEG100 = IC_SEG_GREY;
IC2_SEG108 = IC_SEG_OFF;
IC2_SEG100 = IC_SEG_OFF;
}
}
else
......@@ -1106,8 +1106,8 @@ void SEG_SET_FuelDial(uint8_t m_Flag, uint8_t m_SEG)
}
else
{
IC2_SEG108 = IC_SEG_GREY;
IC2_SEG100 = IC_SEG_GREY;
IC2_SEG108 = IC_SEG_OFF;
IC2_SEG100 = IC_SEG_OFF;
}
}
else
......@@ -1364,8 +1364,8 @@ void SEG_SET_CoolantDial(uint8_t m_Flag, uint8_t m_SEG, uint16_t m_Num, uint8_t
}
else
{
IC1_SEG110 = IC_SEG_GREY;
IC1_SEG103 = IC_SEG_GREY;
IC1_SEG110 = IC_SEG_OFF;
IC1_SEG103 = IC_SEG_OFF;
}
}
else
......@@ -2250,9 +2250,23 @@ void SEG_SET_TPMS_DISPLAY(uint8_t m_Flag, uint16_t m_NUM1, uint16_t m_NUM2, uint
IC2_SEG116 = IC_SEG_OFF;
}
else
{
if(Get_Front_TPMS_ID_Vaild() == 1)
{
SEG_SET_FRONT_TPMS_NUM(Get_Front_FirstLearn_Flag(), m_NUM1, m_valid1);
}
else
{
SEG_SET_FRONT_TPMS_NUM(LearningFailure, m_NUM1, m_valid1);
}
if(Get_Rear_TPMS_ID_Vaild() == 1)
{
SEG_SET_Rear_TPMS_NUM(Get_Rear_FirstLearn_Flag(), m_NUM2, m_valid2);
}
else
{
SEG_SET_Rear_TPMS_NUM(LearningFailure, m_NUM2, m_valid2);
}
}
......
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