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

Merge branch 'dev' of http://tyw-server.synology.me:12345/ty/tianying_ty100 into CHENJIALE

parents e9900263 0f5b4501
......@@ -9,9 +9,9 @@ st_CanMsgTxOp CAN_CH0_CanMsgTxOp;
const st_CAN_SendAttribute CAN_CH0_CANSendAttr[CAN_CH0_ID_SEND_TOTAL] =
{
{0x220ul, 50ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_220, (void *)0},
{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},
{0x6EEul, 100ul * 1000ul, 8ul * 1000ul, 0u, MSG_STD, 2u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_6EE, (void *)0},
{0x6EFul, 100ul * 1000ul, 9ul * 1000ul, 0u, MSG_STD, 3u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_6EF, (void *)0},
{0x450ul, 100ul * 1000ul, 10ul * 1000ul, 0u, MSG_STD, 4u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_450, (void *)0},
#if (IC_Current == TY200_080000b_ty)
{0x580ul, 8ul * 1000ul, 0ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_580, (void *)0},
#endif
......
......@@ -310,15 +310,15 @@ uint8_t Get_Busoff_Status(void)
uint8_t COM_APP_Process(st_CAN_Msg *Msg)
{
Can_Write((st_CAN_Msg *)Msg);
return 0;
}
// Can_Write((st_CAN_Msg *)Msg);
// return 0;
// }
extern uint8_t Can_341_Flg;
void Can_Write(st_CAN_Msg *Msg)
{
// void Can_Write(st_CAN_Msg *Msg)
// {
uint32_t i = 0;
CanTxRxMsg CAN_SendMsg;
uint8_t CAN_result = 0;
CAN_SendMsg.Id = Msg->MsgID; /* ID */
CAN_SendMsg.DLC = Msg->MsgDLC; /* Len */
......@@ -334,27 +334,27 @@ void Can_Write(st_CAN_Msg *Msg)
switch (CAN_SendMsg.Id)
{
case 0x6EE:
CAN_Transmit(CAN0MSG08, &CAN_SendMsg);
CAN_result = CAN_Transmit(CAN0MSG08, &CAN_SendMsg);
break;
case 0x6EF:
CAN_Transmit(CAN0MSG12, &CAN_SendMsg);
CAN_result = CAN_Transmit(CAN0MSG12, &CAN_SendMsg);
break;
case 0x450:
if(Can_341_Flg == 1 || Common_GetIgnOnTime() > 2000)
{
CAN_Transmit(CAN0MSG13, &CAN_SendMsg);
CAN_result = CAN_Transmit(CAN0MSG13, &CAN_SendMsg);
}
break;
case 0x220:
CAN_Transmit(CAN0MSG10, &CAN_SendMsg);
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_Transmit(CAN0MSG14, &CAN_SendMsg);
CAN_result = CAN_Transmit(CAN0MSG14, &CAN_SendMsg);
}
break;
......@@ -362,4 +362,5 @@ void Can_Write(st_CAN_Msg *Msg)
default:
break;
}
return (!CAN_result);
}
......@@ -725,7 +725,7 @@ uint8_t CAN_Transmit(CANMSG_Type *CANxMSGy, CanTxRxMsg* TxMessage)
CANxMSGy->CMCTRL = CAN_MCTRL_CLR_RDY;
/* Wait the operate complete */
while (((CANxMSGy->CMCTRL & CAN_MCTRL_RDY_MASK) != 0x00) && (timeout != 0))
//while (((CANxMSGy->CMCTRL & CAN_MCTRL_RDY_MASK) != 0x00) && (timeout != 0))
{
timeout--;
}
......
......@@ -18,7 +18,7 @@ void Sys_Pseudo_Real_Time_Tasks(void)
void Sys_2ms_Tasks(void)
{
Common_Input_Para();
Can_Write_Fun(&CAN_CH0_CanMsgTxOp, 2000u);
//Can_Write_Fun(&CAN_CH0_CanMsgTxOp, 2000u);
Sys_Status_Update_Service();
Analog_Signal_Conv_Service();
CanMSg_XMS_Analysis(&CAN_CH0_CanMsgOp,2u);
......@@ -121,6 +121,7 @@ void Sys_100ms_Tasks(void)
void Sys_Exact_50us_Tasks(void)
{
static uint32_t task_1ms = 0u;
Can_Write_Fun(&CAN_CH0_CanMsgTxOp, 50u);
DoCAN_Timer_Update(50u);
GenDelay_Tick();
task_1ms++;
......
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