Commit efdecc27 authored by hu's avatar hu

调整报文外发

parent 6f05650c
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
project .intvect 1536
project .text 322892
project .text 324588
project .rodata 411103
project .secinfo 120
project .syscall 6
......
......@@ -269,7 +269,7 @@ uint16_t Fuel_Get_Step(void)
FuelStep = GetFuelStep();
return FuelStep
return FuelStep;
}
uint8_t Fuel_Get_LowAlarm(void)
......
......@@ -4,20 +4,20 @@
const st_CAN_SendAttribute st_CANSendAttr[ID_SEND_TOTAL] =
{
{0x18FEAE17ul, 200ul * 1000ul, 0ul, 0u, MSG_EXT, 2u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FEAE17, (void *)0},
{0x18FF3E17ul, 500ul * 1000ul, 1ul, 0u, MSG_EXT, 3u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FF3E17, (void *)0},
{0x18FED917ul, 100ul * 1000ul, 3ul, 0u, MSG_EXT, 4u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FED917, (void *)0},
{0x18FEE617ul, 1000ul * 1000ul, 5ul, 0u, MSG_EXT, 5u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FEE617, (void *)0},
{0x18EF1817ul, 100ul * 1000ul, 7ul, 0u, MSG_EXT, 6u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18EF1817, (void *)0},
{0x18FEE017ul, 100ul * 1000ul, 11ul, 0u, MSG_EXT, 7u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FEE017, (void *)0},
{0x18FEFC17ul, 1000ul * 1000ul, 13ul, 0u, MSG_EXT, 8u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FEFC17, (void *)0},
{0x18FF2517ul, 1000ul * 1000ul, 17ul, 0u, MSG_EXT, 9u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FF2517, (void *)0},
{0x18FF2A17ul, 2000ul * 1000ul, 19ul, 0u, MSG_EXT, 10u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FF2A17, (void *)0},
{0x18FF9D17ul, 100ul * 1000ul, 23ul, 0u, MSG_EXT, 11u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FF9D17, (void *)0},
{0x18FFE517ul, 1000ul * 1000ul, 29ul, 0u, MSG_EXT, 12u, 8u, CAN_MSG_TX_CYCKE_EVENT, Can_Set_Buff_18FFE517, (void *)0},
{0x18EF2D17ul, 1000ul * 1000ul, 31ul, 0u, MSG_EXT, 13u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18EF2D17, (void *)0},
{0x18033317ul, 100ul * 1000ul, 34ul, 0u, MSG_EXT, 14u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18033317, (void *)0},
{0x180433A2ul, 100ul * 1000ul, 47ul, 0u, MSG_EXT, 15u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_180433A2, (void *)0},
{0x18FEAE17ul, 200ul * 1000ul, 0ul, 0u, MSG_EXT, 3u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FEAE17, (void *)0},
{0x18FF3E17ul, 500ul * 1000ul, 1ul, 0u, MSG_EXT, 4u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FF3E17, (void *)0},
{0x18FED917ul, 100ul * 1000ul, 3ul, 0u, MSG_EXT, 5u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FED917, (void *)0},
{0x18FEE617ul, 1000ul * 1000ul, 5ul, 0u, MSG_EXT, 6u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FEE617, (void *)0},
{0x18EF1817ul, 100ul * 1000ul, 7ul, 0u, MSG_EXT, 7u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18EF1817, (void *)0},
{0x18FEE017ul, 100ul * 1000ul, 11ul, 0u, MSG_EXT, 8u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FEE017, (void *)0},
{0x18FEFC17ul, 1000ul * 1000ul, 13ul, 0u, MSG_EXT, 9u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FEFC17, (void *)0},
{0x18FF2517ul, 1000ul * 1000ul, 17ul, 0u, MSG_EXT, 10u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FF2517, (void *)0},
{0x18FF2A17ul, 2000ul * 1000ul, 19ul, 0u, MSG_EXT, 11u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FF2A17, (void *)0},
{0x18FF9D17ul, 100ul * 1000ul, 23ul, 0u, MSG_EXT, 12u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18FF9D17, (void *)0},
{0x18FFE517ul, 1000ul * 1000ul, 29ul, 0u, MSG_EXT, 13u, 8u, CAN_MSG_TX_CYCKE_EVENT, Can_Set_Buff_18FFE517, (void *)0},
{0x18EF2D17ul, 1000ul * 1000ul, 31ul, 0u, MSG_EXT, 14u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18EF2D17, (void *)0},
{0x18033317ul, 100ul * 1000ul, 34ul, 0u, MSG_EXT, 15u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_18033317, (void *)0},
{0x180433A2ul, 100ul * 1000ul, 47ul, 0u, MSG_EXT, 16u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_180433A2, (void *)0},
};
const st_CANMsgAttribute CAN_MSG_CONST_ARRAY[ID_TOTAL_MAX] =
......
......@@ -18,6 +18,8 @@
#include "Line_in.h"
static uint8_t User_BCM_Flag ;
/*---------------------------------------------------------------------------
使用しない Byte、bit に関しては全て 1(B)をセットして出力すること
对于不使用的Byte、bit,全部设置1(B)并输出
......@@ -48,24 +50,42 @@ void Can_Set_Buff_18FEAE17(uint8_t CopyData[])
if ((K_Line_Set.K_Line_LID42 == 0x00u) || (K_Line_Set.K_Line_LID42 == 0x03u))
{
if (Common_Get_Air1_Data() != 0u)
{
Service_Brake_Circuit1_AirPressure = (uint8_t)((Common_Get_Air1_Data() - 500u) / 20u);
}
else
{
Service_Brake_Circuit1_AirPressure = 0u;
}
if (Common_Get_Air2_Data() != 0u)
{
Service_Brake_Circuit2_AirPressure = (uint8_t)((Common_Get_Air2_Data() - 500u) / 20u);
}
else
{
Service_Brake_Circuit2_AirPressure = 0u;
}
}
else if ((K_Line_Set.K_Line_LID42 == 0x01u) || (K_Line_Set.K_Line_LID42 == 0x02u))
{
if (Common_Get_Air2_Data() != 0u)
{
Service_Brake_Circuit1_AirPressure = (uint8_t)((Common_Get_Air2_Data() - 500u) / 20u);
}
else
{
Service_Brake_Circuit1_AirPressure = 0u;
}
if (Common_Get_Air1_Data() != 0u)
{
Service_Brake_Circuit2_AirPressure = (uint8_t)((Common_Get_Air1_Data() - 500u) / 20u);
}
else
{
Service_Brake_Circuit2_AirPressure = 0u;
}
}
/*电源电压*/
......@@ -255,7 +275,6 @@ void Can_Set_Buff_18FEFC17(uint8_t CopyData[])
uint8_t Fuel_Level_2 = 0u;
uint8_t Engine_Oil_Filter_Differential = 0u;
uint16_t Get_Step = 0u;
Get_Step = Fuel_Get_Step();
......@@ -467,13 +486,13 @@ void Can_Set_Buff_18FF9D17(uint8_t CopyData[])
}
CopyData[0] = (uint8_t)(Fuel_Level & 0xFFu); /* 1 */
CopyData[1] = 0u; /* 2 */
CopyData[2] = 0u; /* 3 */
CopyData[3] = 0u; /* 4 */
CopyData[4] = 0u; /* 5 */
CopyData[5] = 0u; /* 6 */
CopyData[6] = 0u; /* 7 */
CopyData[7] = 0u; /* 8 */
CopyData[1] = 0u; /* 2 */
CopyData[2] = 0u; /* 3 */
CopyData[3] = 0u; /* 4 */
CopyData[4] = 0u; /* 5 */
CopyData[5] = 0u; /* 6 */
CopyData[6] = 0u; /* 7 */
CopyData[7] = 0u; /* 8 */
}
/*-------------------------------------------------------------------------
......@@ -486,25 +505,25 @@ void Can_Set_Buff_18FF9D17(uint8_t CopyData[])
--------------------------------------------------------------------------*/
void Can_Set_Buff_18FFE517(uint8_t CopyData[])
{
uint8_t DTC_Clear_Request = 0u;
uint8_t Req_0Point = 0u;
uint8_t Ferry_Mode_Cancel = 0u;
uint8_t System_Demonstration_Request = 0u;
uint8_t DTC_Clear_Request = 0u;
uint8_t Req_0Point = 0u;
uint8_t Ferry_Mode_Cancel = 0u;
uint8_t System_Demonstration_Request = 0u;
DTC_Clear_Request = 0u;
Req_0Point = 0u;
Ferry_Mode_Cancel = 0u;
System_Demonstration_Request = 0u;
CopyData[0] = (uint8_t)(DTC_Clear_Request & 0xFFu) ; /* 1 */
CopyData[1] = (uint8_t)(Req_0Point & 0xFFu) ; /* 2 */
CopyData[0] = (uint8_t)(DTC_Clear_Request & 0xFFu); /* 1 */
CopyData[1] = (uint8_t)(Req_0Point & 0xFFu); /* 2 */
CopyData[2] = (uint8_t)(((Ferry_Mode_Cancel << 7u) & 0x80U) |
(System_Demonstration_Request & 0x7Fu)) ; /* 3 */
CopyData[3] = 0u; /* 4 */
CopyData[4] = 0u; /* 5 */
CopyData[5] = 0u; /* 6 */
CopyData[6] = 0u; /* 7 */
CopyData[7] = 0u; /* 8 */
(System_Demonstration_Request & 0x7Fu)); /* 3 */
CopyData[3] = 0u; /* 4 */
CopyData[4] = 0u; /* 5 */
CopyData[5] = 0u; /* 6 */
CopyData[6] = 0u; /* 7 */
CopyData[7] = 0u; /* 8 */
}
/*-------------------------------------------------------------------------
* Function Name : Can_Set_Buff_18EF2D17
......@@ -540,13 +559,13 @@ void Can_Set_Buff_18033317(uint8_t CopyData[])
Pair_cmd = 0u;
CopyData[0] = (uint8_t)(Pair_cmd & 0xFFu); /* 1 */
CopyData[1] = 0u; /* 2 */
CopyData[2] = 0u; /* 3 */
CopyData[3] = 0u; /* 4 */
CopyData[4] = 0u; /* 5 */
CopyData[5] = 0u; /* 6 */
CopyData[6] = 0u; /* 7 */
CopyData[7] = 0u; /* 8 */
CopyData[1] = 0u; /* 2 */
CopyData[2] = 0u; /* 3 */
CopyData[3] = 0u; /* 4 */
CopyData[4] = 0u; /* 5 */
CopyData[5] = 0u; /* 6 */
CopyData[6] = 0u; /* 7 */
CopyData[7] = 0u; /* 8 */
}
/*-------------------------------------------------------------------------
* Function Name : Can_Set_Buff_180433A2
......@@ -563,33 +582,184 @@ void Can_Set_Buff_180433A2(uint8_t CopyData[])
Setup_cmd = 0u;
CopyData[0] = (uint8_t)(Setup_cmd & 0xFFu); /* 1 */
CopyData[1] = 0u; /* 2 */
CopyData[2] = 0u; /* 3 */
CopyData[3] = 0u; /* 4 */
CopyData[4] = 0u; /* 5 */
CopyData[5] = 0u; /* 6 */
CopyData[6] = 0u; /* 7 */
CopyData[7] = 0u; /* 8 */
CopyData[1] = 0u; /* 2 */
CopyData[2] = 0u; /* 3 */
CopyData[3] = 0u; /* 4 */
CopyData[4] = 0u; /* 5 */
CopyData[5] = 0u; /* 6 */
CopyData[6] = 0u; /* 7 */
CopyData[7] = 0u; /* 8 */
}
/*-------------------------------------------------------------------------
* Function Name : Can_Set_Buff_18EF1817
* Description :
* Input : None
* Input : None 18EF1817
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
void Can_Set_Buff_18EF1817(uint8_t CopyData[])
{
CopyData[0] = 0u; /* 1 */
CopyData[1] = 0u; /* 2 */
CopyData[2] = 0u; /* 3 */
CopyData[3] = 0u; /* 4 */
CopyData[4] = 0u; /* 5 */
CopyData[5] = 0u; /* 6 */
CopyData[6] = 0u; /* 7 */
CopyData[7] = 0u; /* 8 */
uint8_t Trip_Type = 0u;
if (State_Flag.FState_ClearOilTx == 1)
{
if (Trip_Type == TRAPA)
{
CopyData[0] = 0x40;
CopyData[1] = 0x50;
CopyData[2] = 0x00; //User_ECU.TripA_Fuel_1; //0x00;
CopyData[3] = 0x00; //User_ECU.TripA_Fuel_2; //0x00;
CopyData[4] = 0x00; //User_ECU.TripA_Fuel_3; //0x00;
CopyData[5] = 0x00; //User_ECU.TripA_Fuel_4; //0x00;
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
}
else if (Trip_Type == TRAPB)
{
CopyData[0] = 0x40;
CopyData[1] = 0x60;
CopyData[2] = 0x00; //User_ECU.TripA_Fuel_1; //0x00;
CopyData[3] = 0x00; //User_ECU.TripA_Fuel_2; //0x00;
CopyData[4] = 0x00; //User_ECU.TripA_Fuel_3; //0x00;
CopyData[5] = 0x00; //User_ECU.TripA_Fuel_4; //0x00;
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
}
User_BCM_Flag = 1u;/*从头轮询*/
State_Flag.FState_ClearOilTx = 0u;
}
else
{
if ((State_Flag.FState_ClearOilRx == 0u) && (State_Flag.FState_COilTimeOut != FState_COilTimeOutNum))
{
return ;
}
User_BCM_Flag++;
if (User_BCM_Flag > 11u)
{
User_BCM_Flag = 1u;
}
switch (User_BCM_Flag)
{
case 1:
CopyData[0] = 0x01;
CopyData[1] = 0x50;
CopyData[2] = 0x00;
CopyData[3] = 0x00;
CopyData[4] = 0x00;
CopyData[5] = 0x00;
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
break;
case 2:
CopyData[0] = 0x01;
CopyData[1] = 0x51;
CopyData[2] = 0x00;
CopyData[3] = 0x00;
CopyData[4] = 0x00;
CopyData[5] = 0x00;
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
break;
case 3:
CopyData[0] = 0x01;
CopyData[1] = 0x52;
CopyData[2] = 0x00;
CopyData[3] = 0x00;
CopyData[4] = 0x00;
CopyData[5] = 0x00;
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
break;
case 4:
CopyData[0] = 0x01;
CopyData[1] = 0x53;
CopyData[2] = 0x00;
CopyData[3] = 0x00;
CopyData[4] = 0x00;
CopyData[5] = 0x00;
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
break;
case 5:
CopyData[0] = 0x01;
CopyData[1] = 0x54;
CopyData[2] = 0x00;
CopyData[3] = 0x00;
CopyData[4] = 0x00;
CopyData[5] = 0x00;
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
break;
case 6:
CopyData[0] = 0x01;
CopyData[1] = 0x60;
CopyData[2] = 0x00;
CopyData[3] = 0x00;
CopyData[4] = 0x00;
CopyData[5] = 0x00;
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
break;
case 7:
CopyData[0] = 0x01;
CopyData[1] = 0x61;
CopyData[2] = 0x00;
CopyData[3] = 0x00;
CopyData[4] = 0x00;
CopyData[5] = 0x00;
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
break;
case 8:
CopyData[0] = 0x01;
CopyData[1] = 0x62;
CopyData[2] = 0x00;
CopyData[3] = 0x00;
CopyData[4] = 0x00;
CopyData[5] = 0x00;
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
break;
case 9:
CopyData[0] = 0x01;
CopyData[1] = 0x63;
CopyData[2] = 0x00;
CopyData[3] = 0x00;
CopyData[4] = 0x00;
CopyData[5] = 0x00;
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
break;
case 10:
CopyData[0] = 0x01;
CopyData[1] = 0x64;
CopyData[2] = 0x00;
CopyData[3] = 0x00;
CopyData[4] = 0x00;
CopyData[5] = 0x00;
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
break;
case 11:
CopyData[0] = 0x01;
CopyData[1] = 0x22;
CopyData[2] = 0x00;
CopyData[3] = 0x00;
CopyData[4] = 0x00;
CopyData[5] = 0x00;
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
break;
default:
break;
}
}
}
/*-------------------------------------------------------------------------
......
......@@ -27,9 +27,6 @@
#include "Data_Voltmeter.h"
#include "Data_AirPressure.h"
#define TRAPA 0u
#define TRAPB 1u
uint32_t HYQ_TEST = 3;
volatile _Display_State_Flag State_Flag; /*0-常态 1-小于0 2-小于1000 3-无此功能*/
......
......@@ -6,6 +6,9 @@
#include "images.h"
#include "TYW_stdint.h"
#define TRAPA 0u
#define TRAPB 1u
#define Language_En 0u
#define Language_Cn 1u
......
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