Commit 9151cfb9 authored by 李俭双's avatar 李俭双

feat:依据规范变更,增加胎压学习的外发

parent 09513099
......@@ -12,6 +12,9 @@ const st_CAN_SendAttribute CAN_CH0_CANSendAttr[CAN_CH0_ID_SEND_TOTAL] =
{0x6EEul, 100ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_6EE, (void *)0},
{0x6EFul, 100ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_6EF, (void *)0},
{0x450ul, 100ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_450, (void *)0},
#if (IC_Current == TY200_080000b_ty)
{0x580ul, 10ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_580, (void *)0},
#endif
};
const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
......
......@@ -24,6 +24,9 @@ typedef enum
CAN_CH0_ID_CAN_0x6EE_Msg_Count,
CAN_CH0_ID_CAN_0x6EF_Msg_Count,
CAN_CH0_ID_CAN_0x450_Msg_Count,
#if (IC_Current == TY200_080000b_ty)
CAN_CH0_ID_CAN_0x580_Msg_Count,
#endif
CAN_CH0_ID_SEND_TOTAL,
} CAN_CH0_CAN_MSG_SEND_ID_t;
......
......@@ -100,5 +100,44 @@ void Can_Set_Buff_450(canlib_uint8_t CopyData[])
p450 -> Sig.Rear_Pressure_TX_H = (Get_Rear_TPMS_TX() >> 8) & 0xFF;
p450 -> Sig.Rear_Pressure_TX_L = Get_Rear_TPMS_TX() & 0xFF;
}
void Can_Set_Buff_580(canlib_uint8_t CopyData[])
{
CANMsg580Union *p580;
uint8_t i = 0;
p580 = (CANMsg580Union *)CopyData;
if ( p580 != ( void * )0 )
{
for ( i = 0u; i < 8u; i++ )
{
p580->Msg [ i ] = 0xFFu;
}
}
if(Get_Tpms_TX_Flag() == 1)
{
p580 -> Sig.TPMS_LEARN_CND_BYTE0 = 0x31;
p580 -> Sig.TPMS_LEARN_CND_BYTE1 = 0x01;
p580 -> Sig.TPMS_LEARN_CND_BYTE2 = 0x59;
p580 -> Sig.TPMS_LEARN_CND_BYTE3 = 0x08;
p580 -> Sig.TPMS_LEARN_CND_BYTE4 = 0x00;
}
else if(Get_Tpms_TX_Flag() == 1)
{
p580 -> Sig.TPMS_LEARN_CND_BYTE0 = 0x31;
p580 -> Sig.TPMS_LEARN_CND_BYTE1 = 0x01;
p580 -> Sig.TPMS_LEARN_CND_BYTE2 = 0x59;
p580 -> Sig.TPMS_LEARN_CND_BYTE3 = 0x08;
p580 -> Sig.TPMS_LEARN_CND_BYTE4 = 0x01;
}
else
{
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;
}
}
......@@ -89,6 +89,20 @@ typedef union
} Sig;
} CANMsg450Union;
typedef union
{
uint8_t Msg [ 8 ];
struct
{
uint8_t TPMS_LEARN_CND_BYTE0 : 8;
uint8_t TPMS_LEARN_CND_BYTE1 : 8;
uint8_t TPMS_LEARN_CND_BYTE2 : 8;
uint8_t TPMS_LEARN_CND_BYTE3 : 8;
uint8_t TPMS_LEARN_CND_BYTE4 : 8;
uint32_t Res1 : 24;
} Sig;
} CANMsg580Union;
......@@ -96,6 +110,7 @@ void Can_Set_Buff_220(canlib_uint8_t CopyData[]);
void Can_Set_Buff_6EE(canlib_uint8_t CopyData[]);
void Can_Set_Buff_6EF(canlib_uint8_t CopyData[]);
void Can_Set_Buff_450(canlib_uint8_t CopyData[]);
void Can_Set_Buff_580(canlib_uint8_t CopyData[]);
#endif
......@@ -173,6 +173,20 @@ void Can_Tx_Apply_Buff(void)
CAN_MessageCache_DeInit(CAN0MSG10);
CAN_MessageCache_Init(CAN0MSG10, &CAN_SendMsg);
CAN_SendMsg.Id = 0x580;
CAN_SendMsg.IDE = CAN_Id_Standard;
CAN_SendMsg.CacheType = CAN_CacheType_Tx;
CAN_SendMsg.RTR = CAN_RTR_Data;
CAN_RecvMsg.Interrupt = DISABLE;
CAN_SendMsg.DLC = 8;
for (uint8_t i = 0; i < CAN_SendMsg.DLC; i++)
{
CAN_SendMsg.Data[i] = 0;
}
CAN_MessageCache_DeInit(CAN0MSG14);
CAN_MessageCache_Init(CAN0MSG14, &CAN_SendMsg);
CAN_SendMsg_Diag_Tx.Id = DIAG_ID_Tx;
......@@ -321,7 +335,9 @@ void Can_Write(st_CAN_Msg *Msg)
case 0x220:
CAN_Transmit(CAN0MSG10, &CAN_SendMsg);
break;
case 0x580:
CAN_Transmit(CAN0MSG14, &CAN_SendMsg);
break;
default:
break;
}
......
......@@ -130,6 +130,7 @@ static void Power_Wakeup_Init(void)
TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High);
Telltales_Init();
Telltales_UserInit();
Data_TPMS_KL15_WAKE_UP_Init();
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(WAKEUP_KL15_In,Trigger_Rising);
}
......@@ -160,6 +161,7 @@ static void Power_IG_ON_Init(void)
MenuData_TCS_Init();
Data_Coolant_Temp_KL15_Init();
BlueTooth_KL30_KL15_Wakeup_Init();
Data_TPMS_KL15_WAKE_UP_Init();
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
}
......
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