Commit 8eea069c authored by hu's avatar hu

增加报文发送5次的控制

parent 0456ea0f
#include "CAN_Communication_Matrix.h"
#include "CAN_FUNC.h"
#include "Common_Interface.h"
/* 2021/09/22 11:03:12 */
const st_CAN_SendAttribute st_CANSendAttr[ID_SEND_TOTAL] =
......@@ -309,7 +310,7 @@ const st_CANMsgAttribute CAN_MSG_CONST_ARRAY[ID_TOTAL_MAX] =
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
2000ul,
0x18EF1718ul,
(( void * )0),
(Common_Set_18EF1718_Msg_Sta),
(( void * )0),
(( void * )0),
},
......
......@@ -24,23 +24,23 @@
#include "FuelConfig.h"
#include "CD4051.h"
uint8_t TpmsMsg18033317SendFlag = 0;
uint8_t Msg_18021733[8];
static uint8_t TXNum_18033317;
static uint8_t User_BCM_Flag;
uint32_t DisDTCNumber[50];
uint8_t DisDTCNum;
uint8_t Id18FFE517Msg_TXSUCCESSNum;
static uint8_t Water_Temp_Level_Flag;
/*---------------------------------------------------------------------------
使用しない Byte、bit に関しては全て 1(B)をセットして出力すること
对于不使用的Byte、bit,全部设置1(B)并输出
----------------------------------------------------------------------------*/
USER_ECU User_ECU;
#pragma alignvar(8)
uint8_t Msg_18021733[8];
static uint32_t TXNum_18033317;
static uint32_t Water_Temp_Level_Flag;
static uint32_t User_BCM_Flag = 12u;
static uint32_t Send_18EF1718_Msg_Sta = 0u;
uint32_t DisDTCNumber[50];
uint32_t DisDTCNum;
uint32_t Id18FFE517Msg_TXSUCCESSNum;
/*-------------------------------------------------------------------------
* Function Name : Can_Set_Buff_18FEAE17
* Description :
......@@ -1106,10 +1106,20 @@ void Can_Set_Buff_18EF1817(uint8_t CopyData[])
}
else
{
User_BCM_Flag++;
if (User_BCM_Flag > 11u)
/*增加发送5次机制*/
if (((Common_Get_18EF1718_Msg_Sta() == COMMON_Valid) && (Send_18EF1718_Msg_Sta >= 1u)) ||
(Send_18EF1718_Msg_Sta >= 6u))
{
User_BCM_Flag++;
if (User_BCM_Flag > 12u)
{
User_BCM_Flag = 1u;
}
}
else
{
User_BCM_Flag = 1u;
if (Send_18EF1718_Msg_Sta <= 10)
Send_18EF1718_Msg_Sta++;
}
switch (User_BCM_Flag)
......@@ -1224,6 +1234,16 @@ void Can_Set_Buff_18EF1817(uint8_t CopyData[])
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
break;
case 12:
CopyData[0] = 0x01;
CopyData[1] = 0x30;
CopyData[2] = 0x00;
CopyData[3] = 0x00;
CopyData[4] = 0x00;
CopyData[5] = 0x00;
CopyData[6] = 0xFF;
CopyData[7] = 0xFF;
break;
default:
break;
}
......@@ -1546,7 +1566,7 @@ void Common_SetTXNum_18033317(void)
uint8_t Common_GetTXNum_18033317(void)
{
return TXNum_18033317;
return (uint8_t)TXNum_18033317;
}
/*-------------------------------------------------------------------------
......
......@@ -16,12 +16,12 @@ typedef struct
uint32_t TripB_Idling;
uint32_t TripB_Runing;
uint32_t Engine_Surplus;
uint32_t Reserved1;
} USER_ECU;
extern USER_ECU User_ECU;
extern uint32_t DisDTCNumber[50];
extern uint8_t DisDTCNum;
extern uint32_t DisDTCNum;
extern void Can_Set_Buff_18FEAE17(uint8_t CopyData[]);
......
......@@ -40,6 +40,8 @@ static DataValid_t Act_E_Speed_Valid;
static DataValid_t Disp_V_Speed_Valid;
static DataValid_t Disp_E_Speed_Valid;
static DataValid_t Set_18EF1718_Msg_Sta;
static void Common_Set_Act_V_Speed(uint16_t Val);
static void Common_Set_Act_E_Speed(uint16_t Val);
static void Common_Set_Disp_V_Speed(uint16_t Val);
......@@ -132,6 +134,7 @@ void Common_DataInit(void)
TPMS_TEST_OFF_TIME = 0x00u;
Menu_FacDea_Time = 0x00u;
Set_18EF1718_Msg_Sta = COMMON_InValid;
//Menu_Off_Time = 0x00u;
}
......@@ -857,6 +860,16 @@ uint32_t Coom_Get_Menu_Off_Time(void)
return Menu_Off_Time;
}
void Common_Set_18EF1718_Msg_Sta(void)
{
Set_18EF1718_Msg_Sta = COMMON_Valid;
}
DataValid_t Common_Get_18EF1718_Msg_Sta(void)
{
return Set_18EF1718_Msg_Sta;
}
/*EOL诊断配置数据转换为仪表配置数据*/
void ReadDTCEOLValue_Meter_K_LINE(void)
{
......
......@@ -56,6 +56,9 @@ uint32_t Common_Get_Menu_FacDea_Time_Sta(void);
uint8_t Common_Get_TPMS_TEST_OFF_Time_Sta(void);
uint32_t Coom_Get_Menu_Off_Time(void);
void Common_Set_18EF1718_Msg_Sta(void);
DataValid_t Common_Get_18EF1718_Msg_Sta(void);
void ReadDTCEOLValue_Meter_K_LINE(void);
void Common_Set_K_Line_Value(void);
......
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