Commit adf32974 authored by 陈家乐's avatar 陈家乐

🐞 fix:添加220心跳及校验外发

parent 3e3a1bc4
......@@ -3,10 +3,12 @@
#include "Application.h"
uint16_t CAN_TX_Count = 0;
uint16_t AliveCountTimer = 0;
extern uint8_t Tpms_TX_Flag;
void CAN_TX_Count_Init(void)
{
CAN_TX_Count = 0;
AliveCountTimer = 0;
}
void Can_Set_Buff_220(canlib_uint8_t CopyData[])
{
......@@ -22,6 +24,17 @@ void Can_Set_Buff_220(canlib_uint8_t CopyData[])
}
p220 -> Sig.TCS_TX = Get_Dis_Tcs_Val();
p220 -> Sig.AliveCounter = AliveCountTimer;
p220 -> Sig.CheckSum = (Get_Dis_Tcs_Val() == 1) ? 8 : 0;
}
if(AliveCountTimer < 7)
{
AliveCountTimer++;
}
else
{
AliveCountTimer = 0;
}
}
......
......@@ -19,8 +19,9 @@ typedef union
uint32_t Res3: 16;
uint32_t Res4: 16;
uint32_t Res5: 8;
uint32_t AliveCounter: 3;
uint32_t CheckSum: 5;
uint32_t AliveCounter: 3;
} Sig;
} CANMsg220Union;
......
......@@ -245,6 +245,7 @@ static Power_Status_em Power_Stay_OFF(void)
return u8PowerSts;
}
extern uint16_t AliveCountTimer;
static Power_Status_em Power_Stay_Protect(void)
{
Power_Status_em u8PowerSts;
......@@ -257,6 +258,7 @@ static Power_Status_em Power_Stay_Protect(void)
BU98R10_Shutdown( );
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 0);
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Disable);
AliveCountTimer = 0;
}
u8PowerSts = EM_IGN_OFF_Init;
/* 电溝模弝正常 */
......
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