Commit 670081b4 authored by hu's avatar hu

调整诊断外发

parent 108ed7ec
......@@ -2490,10 +2490,10 @@ void LevelF2_1Menu_2Enter(void)
//03 19 02 0C 55 55 55 55
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DA0BF0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x03u;
......@@ -2547,10 +2547,10 @@ void LevelF2_1Menu_3Enter(void)
//03 19 02 0C 55 55 55 55
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DA03F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x03u;
......@@ -2604,10 +2604,10 @@ void LevelF2_1Menu_4Enter(void)
//03 19 02 0C 55 55 55 55
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DAA0F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x03u;
......@@ -2661,10 +2661,10 @@ void LevelF2_1Menu_5Enter(void)
//03 19 02 0C 55 55 55 55
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DAE8F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x03u;
......@@ -2718,10 +2718,10 @@ void LevelF2_1Menu_6Enter(void)
//03 19 02 0C 55 55 55 55
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DA10F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x03u;
......@@ -2842,7 +2842,7 @@ void LevelF3_2Menu_1Enter(void)
canMag.MsgID = 0x7E0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 0u;
canMag.MsgPro = 1u;
canMag.MsgStd = 0u;
canMag.MsgRTR = 0u;
......@@ -2882,10 +2882,10 @@ void LevelF3_2Menu_2Enter(void)
{
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DA0BF0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x04u;
......@@ -2924,10 +2924,10 @@ void LevelF3_2Menu_3Enter(void)
{
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DA03F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x04u;
......@@ -2966,10 +2966,10 @@ void LevelF3_2Menu_4Enter(void)
{
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DAA0F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x04u;
......@@ -3008,10 +3008,10 @@ void LevelF3_2Menu_5Enter(void)
{
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DAE8F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x04u;
......@@ -3050,10 +3050,10 @@ void LevelF3_2Menu_6Enter(void)
{
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DA10F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x04u;
......@@ -3173,27 +3173,7 @@ void LevelD0Menu_1Exit(void)
/*----经销商模式----DTC显示----*/
void LevelD1Menu_1Enter(void)
{
//03 19 02 0C 55 55 55 55
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x03u;
canMag.Msg[1u] = 0x19u;
canMag.Msg[2u] = 0x02u;
canMag.Msg[3u] = 0x0Cu;
canMag.Msg[4u] = 0x00u;
canMag.Msg[5u] = 0x00u;
canMag.Msg[6u] = 0x00u;
canMag.Msg[7u] = 0x00u;
Can_Write(&canMag);
}
{}
void LevelD1Menu_1Do(void)
{
GUI_OftenShow_Display();
......@@ -3527,10 +3507,10 @@ void LevelD2_1Menu_2Enter(void)
//03 19 02 0C 55 55 55 55
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DA0BF0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x03u;
......@@ -3584,10 +3564,10 @@ void LevelD2_1Menu_3Enter(void)
//03 19 02 0C 55 55 55 55
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DA03F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x03u;
......@@ -3641,10 +3621,10 @@ void LevelD2_1Menu_4Enter(void)
//03 19 02 0C 55 55 55 55
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DAA0F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x03u;
......@@ -3698,10 +3678,10 @@ void LevelD2_1Menu_5Enter(void)
//03 19 02 0C 55 55 55 55
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DAE8F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x03u;
......@@ -3755,10 +3735,10 @@ void LevelD2_1Menu_6Enter(void)
//03 19 02 0C 55 55 55 55
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DA10F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x03u;
......@@ -3879,7 +3859,7 @@ void LevelD3_2Menu_1Enter(void)
canMag.MsgID = 0x7E0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 0u;
canMag.MsgPro = 1u;
canMag.MsgStd = 0u;
canMag.MsgRTR = 0u;
......@@ -3919,10 +3899,10 @@ void LevelD3_2Menu_2Enter(void)
{
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DA0BF0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x04u;
......@@ -3961,10 +3941,10 @@ void LevelD3_2Menu_3Enter(void)
{
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DA03F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x04u;
......@@ -4003,10 +3983,10 @@ void LevelD3_2Menu_4Enter(void)
{
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DAA0F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x04u;
......@@ -4045,10 +4025,10 @@ void LevelD3_2Menu_5Enter(void)
{
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DAE8F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x04u;
......@@ -4087,10 +4067,10 @@ void LevelD3_2Menu_6Enter(void)
{
_CAN_Msg canMag;
canMag.MsgID = 0x7E0u;
canMag.MsgID = 0x18DA10F0u;
canMag.MsgDLC = 8u;
canMag.MsgPro = 0u;
canMag.MsgStd = 0u;
canMag.MsgPro = 2u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = 0x04u;
......
......@@ -148,7 +148,13 @@ void Can_Read_Msg(uint32_t m_id, uint8_t m_dlc, uint8_t m_Msg[])
Co_Can_Buff_Set(Co_Can_ConvertSubID(m_id), m_dlc, m_Msg);
if ((m_id == 0x18DAF003) || (m_id == 0x18DAF00B))
if (
(m_id == 0x18DAF003u) ||
(m_id == 0x18DAF00Bu) ||
(m_id == 0x18DAF010u) ||
(m_id == 0x18DAF0A0u) ||
(m_id == 0x18DAF0E8u)
)
{
Common_Set_UdsCanIDSta(m_id);
LK_Link_main(m_id, (uint8_t*)m_Msg, (m_dlc & 0x0f));
......
......@@ -8,6 +8,7 @@
#include "app_ServiceProc.h"
#include <string.h>
#include "RTE_CAN.h"
#include "Common_Interface.h"
volatile _N_USData N_US_R_MultiData;
volatile _N_USData N_US_S_MultiData; //仪表外发的数据信息-multi
......@@ -499,10 +500,67 @@ void TP_ReciveMultiF_handle(void)
--------------------------------------------------------------------------*/
void TP_TransmitPDU(void)
{
g_txCanMsg.id = ID_BCM_PhyAddr;
_CAN_Msg canMag;
uint32_t UdsCanID = 0u;
UdsCanID = Common_Get_UdsCanIDSta();
switch (UdsCanID)
{
case ID_BCM_ResAddr:
g_txCanMsg.id = ID_BCM_PhyAddr;
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgRTR = 0u;
break;
case 0x18DAF003u:
g_txCanMsg.id = 0x18DA03F0u;
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
break;
case 0x18DAF00Bu:
g_txCanMsg.id = 0x18DA0BF0u;
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
break;
case 0x18DAF010u:
g_txCanMsg.id = 0x18DA10F0u;
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
break;
case 0x18DAF0A0u:
g_txCanMsg.id = 0x18DAA0F0u;
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
break;
case 0x18DAF0E8u:
g_txCanMsg.id = 0x18DAE8F0u;
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
break;
default:
break;
}
if (N_US_S_MultiData.ind.N_Result == N_OK_2) //no use
{
if (N_US_S_Data_FF.ind.N_PCI == 0)
......@@ -514,12 +572,6 @@ void TP_TransmitPDU(void)
//g_bReturn = bsp_CANSendFrame(g_txCanMsg.id, txResNum, (uint8_t *)&g_txCanMsg.msg[0], 8);
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = g_txCanMsg.msg[0u];
canMag.Msg[1u] = g_txCanMsg.msg[1u];
canMag.Msg[2u] = g_txCanMsg.msg[2u];
......@@ -546,12 +598,6 @@ void TP_TransmitPDU(void)
//g_bReturn = bsp_CANSendFrame(g_txCanMsg.id, txResNum, (uint8_t *)&g_txCanMsg.msg[0], 8);
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = g_txCanMsg.msg[0u];
canMag.Msg[1u] = g_txCanMsg.msg[1u];
canMag.Msg[2u] = g_txCanMsg.msg[2u];
......@@ -615,12 +661,6 @@ void TP_TransmitPDU(void)
//g_bReturn = bsp_CANSendFrame(g_txCanMsg.id, txResNum, (uint8_t *)&g_txCanMsg.msg[0], 8);
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = g_txCanMsg.msg[0u];
canMag.Msg[1u] = g_txCanMsg.msg[1u];
canMag.Msg[2u] = g_txCanMsg.msg[2u];
......@@ -650,12 +690,6 @@ void TP_TransmitPDU(void)
//g_bReturn = bsp_CANSendFrame(g_txCanMsg.id, txResNum, (uint8_t *)&g_txCanMsg.msg[0], 8);
/*重新赋值----20220326----*/
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = g_txCanMsg.msg[0u];
canMag.Msg[1u] = 0x00u;//g_txCanMsg.msg[1u];
canMag.Msg[2u] = g_txCanMsg.msg[2u];
......@@ -682,6 +716,8 @@ void TP_TransmitNegatePDU(_ErrorFrame *Err)
{
_CAN_Msg canMag;
uint32_t UdsCanID = 0u;
if (Err->FrameErr)
{
if (N_US_R_Data_FF.ind.N_SID == Err->RespSerId)
......@@ -727,7 +763,63 @@ void TP_TransmitNegatePDU(_ErrorFrame *Err)
(Err->FrameErr != SubFunctionNotSupported) &&
(Err->FrameErr != RequestOutOfRange))
{
g_txCanMsg.id = ID_BCM_PhyAddr;
UdsCanID = Common_Get_UdsCanIDSta();
switch (UdsCanID)
{
case ID_BCM_ResAddr:
g_txCanMsg.id = ID_BCM_PhyAddr;
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgRTR = 0u;
break;
case 0x18DAF003u:
g_txCanMsg.id = 0x18DA03F0u;
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
break;
case 0x18DAF00Bu:
g_txCanMsg.id = 0x18DA0BF0u;
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
break;
case 0x18DAF010u:
g_txCanMsg.id = 0x18DA10F0u;
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
break;
case 0x18DAF0A0u:
g_txCanMsg.id = 0x18DAA0F0u;
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
break;
case 0x18DAF0E8u:
g_txCanMsg.id = 0x18DAE8F0u;
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 2u;//0u;
canMag.MsgStd = 1u;
canMag.MsgRTR = 0u;
break;
default:
break;
}
g_txCanMsg.msg[0] = 3;
g_txCanMsg.msg[1] = NegativeId;
g_txCanMsg.msg[2] = Err->RespSerId;
......@@ -740,12 +832,6 @@ void TP_TransmitNegatePDU(_ErrorFrame *Err)
//g_bReturn = bsp_CANSendFrame(g_txCanMsg.id, txResNum, (uint8_t *)&g_txCanMsg.msg[0], 8);
canMag.MsgID = g_txCanMsg.id;
canMag.MsgDLC = 8u;
canMag.MsgPro = 1u;//0u;
canMag.MsgStd = 0u;
canMag.MsgRTR = 0u;
canMag.Msg[0u] = g_txCanMsg.msg[0u];
canMag.Msg[1u] = g_txCanMsg.msg[1u];
canMag.Msg[2u] = g_txCanMsg.msg[2u];
......
......@@ -214,6 +214,7 @@ void Sys_Run_Mode_50ms_Tasks(void)
Sound_Scheduling_Service();
// BGTask();
IS31_Scan_Refresh();
Common_DTC_Server();
Drive_Info_IC1_STATUS_Rx();
Drive_Info_IC3_STATUS_Rx();
......@@ -227,7 +228,6 @@ void Sys_Run_Mode_50ms_Tasks(void)
//uint32_t YZHD_Count = 0;
void Sys_Run_Mode_100ms_Tasks(void)
{
BL_Management_service();
RTE_RTC_Services_100Ms_Cbk();
Data_ODO_Processing();
......@@ -253,7 +253,6 @@ void Sys_Run_Mode_100ms_Tasks(void)
Data_GsLYbL_Speed_Processing();
/**/
Common_Set_K_Line_Value();
Common_DTC_Server();
DoCAN_Get_Multi_frame00_Recv();
DoCAN_Get_Multi_frame03_Recv();
......
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