Commit b7969cf3 authored by huangguoqing's avatar huangguoqing

feat:诊断获取软件版本号

parent dcd21f87
...@@ -156,13 +156,21 @@ void Can_Abort_All(void) ...@@ -156,13 +156,21 @@ void Can_Abort_All(void)
} }
/*****Lower*******/ /*****Lower*******/
/**
* @brief 从CAN通道读取消息
*
* 该函数用于从指定的CAN通道读取消息,并根据消息ID进行相应的处理。
*
* @param m_id 消息ID
* @param m_dlc 数据长度码(DLC)
* @param m_Msg 消息数据数组
*/
void Can_Read_Msg(uint32_t m_id, uint8_t m_dlc, uint8_t m_Msg []) void Can_Read_Msg(uint32_t m_id, uint8_t m_dlc, uint8_t m_Msg [])
{ {
Co_Can_Buff_Set(&CAN_CH4_CanMsgOp, Co_Can_ConvertSubID_CAN_CH4(m_id),m_dlc, m_Msg); Co_Can_Buff_Set(&CAN_CH4_CanMsgOp, Co_Can_ConvertSubID_CAN_CH4(m_id),m_dlc, m_Msg);
//UDS_ReceivedMsg(m_id, m_dlc); //UDS_ReceivedMsg(m_id, m_dlc);
if ( (m_id == DIAG_ID_Rx_FUN) || (m_id == DIAG_ID_Rx_PHY) ) if ( (m_id == DIAG_ID_Rx_FUN) || (m_id == DIAG_ID_Rx_PHY) )
{ {
DoCAN_L_Data_Indication(m_id, m_dlc, m_Msg); DoCAN_L_Data_Indication(m_id, m_dlc, m_Msg);
} }
} }
......
...@@ -65,6 +65,8 @@ void Sys_Run_Mode_2ms_Tasks_Group(void) ...@@ -65,6 +65,8 @@ void Sys_Run_Mode_2ms_Tasks_Group(void)
{ {
RTE_ADC_Services( ); RTE_ADC_Services( );
Get_static_Current(); Get_static_Current();
COM_RX_Process( );
COM_TX_Process();
} }
/*============================================================================== /*==============================================================================
...@@ -72,8 +74,7 @@ void Sys_Run_Mode_2ms_Tasks_Group(void) ...@@ -72,8 +74,7 @@ void Sys_Run_Mode_2ms_Tasks_Group(void)
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
void Sys_Run_Mode_5ms_Tasks_Group(void) void Sys_Run_Mode_5ms_Tasks_Group(void)
{ {
COM_RX_Process( );
COM_TX_Process();
} }
/*============================================================================== /*==============================================================================
...@@ -128,32 +129,41 @@ uint8_t *pcan_data = &can_flag; ...@@ -128,32 +129,41 @@ uint8_t *pcan_data = &can_flag;
uint8_t test[10] = {0x56,0x0B,0x0C,0x0D,0x1,0x2,0x3,0x4,0x05,0xFF}; uint8_t test[10] = {0x56,0x0B,0x0C,0x0D,0x1,0x2,0x3,0x4,0x05,0xFF};
void Sys_Run_Mode_100ms_Tasks_Group(void) void Sys_Run_Mode_100ms_Tasks_Group(void)
{ {
Display_PageNum(); Display_PageNum();
User_CheckMode_Service(100u); User_CheckMode_Service(100u);
//TFT_LCD_Draw_Bmp(3, 40, ( uint8_t * )gImage_Dsy_words_1X6_Y16);
POWER_CTRL_KL30 = 1; POWER_CTRL_KL30 = 1;
POWER_CTRL_KL30_B = 1; POWER_CTRL_KL30_B = 1;
testtime++; //POWER_CTRL_KL15 = 1;
// testtime++;
// if((testtime > 0)&&(testtime < 20)) // if((testtime > 50)&&(testtime < 70))
// {
// can_flag=1;
// }
// else if((testtime > 80)&&(testtime < 100))
// { // {
// Left_Led = 1; // can_flag=2;
// Right_Led = 1;
// Headlights_Led = 1;
// } // }
// else // else if((testtime > 120)&&(testtime < 140))
// { // {
// Left_Led = 0; // can_flag=3;
// Right_Led = 0; // }
// Headlights_Led = 0; // else if((testtime > 160)&&(testtime < 180))
// {
// can_flag=4;
// } // }
// if(testtime > 40) // if(testtime > 200)
// { // {
// testtime = 0; // testtime = 0;
// } // }
// General_Number_Disp(test, 100 , 100 );
} }
/*=================================================================*/ /*=================================================================*/
......
...@@ -19,7 +19,7 @@ extern uint8_t CAN_Current_state; ...@@ -19,7 +19,7 @@ extern uint8_t CAN_Current_state;
******************************************************************************/ ******************************************************************************/
/****************************************************************************** /******************************************************************************
锟斤拷锟斤拷锟斤拷锟斤拷UDS_Server_Application_Service 锟斤拷锟斤拷锟斤拷锟斤拷UDS_Server_Application_Service
�� �ܣ�UDS������Ӧ�ò���Ʒ��� 锟斤拷 锟杰o拷UDS锟斤拷锟斤拷锟斤拷应锟矫诧拷锟斤拷品锟斤拷锟?
锟斤拷 锟斤拷锟斤拷锟斤拷 锟斤拷 锟斤拷锟斤拷锟斤拷
锟斤拷锟斤拷值锟斤拷锟斤拷 锟斤拷锟斤拷值锟斤拷锟斤拷
******************************************************************************* *******************************************************************************
...@@ -31,7 +31,7 @@ void UDS_Server_Application_Service(void) ...@@ -31,7 +31,7 @@ void UDS_Server_Application_Service(void)
} }
/****************************************************************************** /******************************************************************************
�Ự���²�ӿڼ���ʱ����ʵ�� 锟结话锟斤拷锟铰诧拷涌诩锟斤拷锟绞憋拷锟斤拷锟绞碉拷锟?
******************************************************************************/ ******************************************************************************/
/****************************************************************************** /******************************************************************************
...@@ -39,8 +39,8 @@ void UDS_Server_Application_Service(void) ...@@ -39,8 +39,8 @@ void UDS_Server_Application_Service(void)
锟斤拷 锟杰o拷锟矫凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 锟斤拷 锟杰o拷锟矫凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
This service is used to request the transfer of data. If necessary, the This service is used to request the transfer of data. If necessary, the
network layer segments the data. network layer segments the data.
�� ����N_TAtype ��Ŀ���ַ����,����������ʹ�� DIAG_ID_Tx 锟斤拷 锟斤拷锟斤拷N_TAtype 锟斤拷目锟斤拷锟街凤拷锟斤拷锟?,锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷使锟斤拷 DIAG_ID_Tx
MessageData ������������� MessageData 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟?
Length 锟斤拷锟斤拷锟捷筹拷锟斤拷 Length 锟斤拷锟斤拷锟捷筹拷锟斤拷
锟斤拷锟斤拷值锟斤拷锟斤拷 锟斤拷锟斤拷值锟斤拷锟斤拷
******************************************************************************/ ******************************************************************************/
...@@ -53,13 +53,13 @@ void UDS_N_USData_Request(uint32_t N_TAtype, uint8_t *MessageData, uint16_t Leng ...@@ -53,13 +53,13 @@ void UDS_N_USData_Request(uint32_t N_TAtype, uint8_t *MessageData, uint16_t Leng
/****************************************************************************** /******************************************************************************
锟斤拷锟斤拷锟斤拷锟斤拷UDS_N_USData_Confirm 锟斤拷锟斤拷锟斤拷锟斤拷UDS_N_USData_Confirm
�� �ܣ��÷�����������㷢��,����ȷ��ǰһ��ʹ��N_USData.request������ 锟斤拷 锟杰o拷锟矫凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷惴?拷锟?,锟斤拷锟斤拷确锟斤拷前一锟斤拷使锟斤拷N_USData.request锟斤拷锟斤拷锟斤拷
N_TAtype��ַ���͵������Ƿ������ N_TAtype锟斤拷址锟斤拷锟酵碉拷锟斤拷锟斤拷锟角凤拷锟斤拷锟斤拷锟?
The N_USData.confirm service is issued by the network layer. The service The N_USData.confirm service is issued by the network layer. The service
primitive confirms the completion of an N_USData.request service primitive confirms the completion of an N_USData.request service
identified by the address information in N_TAtype. identified by the address information in N_TAtype.
�� ����N_TAtype ��N_USData.confirm��������ķ��͵�ַ 锟斤拷 锟斤拷锟斤拷N_TAtype 锟斤拷N_USData.confirm锟斤拷锟斤拷锟斤拷锟斤拷姆锟斤拷偷锟街?
N_Result ��N_USData.request����Ĵ���״̬ N_Result 锟斤拷N_USData.request锟斤拷锟斤拷拇锟斤拷锟阶刺?
锟斤拷锟斤拷值锟斤拷锟斤拷 锟斤拷锟斤拷值锟斤拷锟斤拷
******************************************************************************/ ******************************************************************************/
extern void UDS_N_USData_Confirm(uint32_t N_TAtype, N_ResultEnum N_Result) extern void UDS_N_USData_Confirm(uint32_t N_TAtype, N_ResultEnum N_Result)
...@@ -78,7 +78,7 @@ extern void UDS_N_USData_Confirm(uint32_t N_TAtype, N_ResultEnum N_Result) ...@@ -78,7 +78,7 @@ extern void UDS_N_USData_Confirm(uint32_t N_TAtype, N_ResultEnum N_Result)
/****************************************************************************** /******************************************************************************
锟斤拷锟斤拷锟斤拷锟斤拷UDS_N_USData_FF_Indication 锟斤拷锟斤拷锟斤拷锟斤拷UDS_N_USData_FF_Indication
�� �ܣ��÷�����������㷢��,�������ϲ�ָʾ��ַΪN_TAtype��һ���֡���ݵ���֡ 锟斤拷 锟杰o拷锟矫凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷惴?拷锟?,锟斤拷锟斤拷锟斤拷锟较诧拷指示锟斤拷址为N_TAtype锟斤拷一锟斤拷锟街★拷锟斤拷莸锟斤拷锟街?
锟侥碉拷锟斤拷 锟侥碉拷锟斤拷
The N_USData_FF.indication service is issued by the network layer. The The N_USData_FF.indication service is issued by the network layer. The
service primitive indicates to the adjacent upper layer the arrival of service primitive indicates to the adjacent upper layer the arrival of
...@@ -96,7 +96,7 @@ extern void UDS_N_USData_FF_Indication(uint32_t N_TAtype, uint16_t Length) ...@@ -96,7 +96,7 @@ extern void UDS_N_USData_FF_Indication(uint32_t N_TAtype, uint16_t Length)
/****************************************************************************** /******************************************************************************
锟斤拷锟斤拷锟斤拷锟斤拷UDS_N_USData_Indication 锟斤拷锟斤拷锟斤拷锟斤拷UDS_N_USData_Indication
�� �ܣ��÷�����������㷢��,�������ϲ�ָ����N_TAtype��ַ�������ij���ΪLength 锟斤拷 锟杰o拷锟矫凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷惴?拷锟?,锟斤拷锟斤拷锟斤拷锟较诧拷指锟斤拷锟斤拷N_TAtype锟斤拷址锟斤拷锟斤拷锟斤拷锟侥筹拷锟斤拷为Length
锟斤拷MessageData锟斤拷锟捷的达拷锟酵斤拷锟絅_Result,锟斤拷同时锟斤拷锟斤拷锟斤拷一锟斤拷锟斤拷 锟斤拷MessageData锟斤拷锟捷的达拷锟酵斤拷锟絅_Result,锟斤拷同时锟斤拷锟斤拷锟斤拷一锟斤拷锟斤拷
The N_USData.indication service is issued by the network layer. The The N_USData.indication service is issued by the network layer. The
service primitive indicates <N_Result> events and delivers service primitive indicates <N_Result> events and delivers
...@@ -106,7 +106,7 @@ extern void UDS_N_USData_FF_Indication(uint32_t N_TAtype, uint16_t Length) ...@@ -106,7 +106,7 @@ extern void UDS_N_USData_FF_Indication(uint32_t N_TAtype, uint16_t Length)
锟斤拷 锟斤拷锟斤拷N_TAtype 锟斤拷锟斤拷锟秸碉拷锟斤拷锟斤拷锟捷碉拷址锟斤拷息 锟斤拷 锟斤拷锟斤拷N_TAtype 锟斤拷锟斤拷锟秸碉拷锟斤拷锟斤拷锟捷碉拷址锟斤拷息
MessageData 锟斤拷锟斤拷锟秸碉拷锟斤拷锟斤拷锟斤拷 (锟斤拷锟斤拷N_Result为N_OK时锟斤拷效) MessageData 锟斤拷锟斤拷锟秸碉拷锟斤拷锟斤拷锟斤拷 (锟斤拷锟斤拷N_Result为N_OK时锟斤拷效)
Length 锟斤拷锟斤拷锟秸碉拷锟斤拷锟斤拷锟捷筹拷锟斤拷 (锟斤拷锟斤拷N_Result为N_OK时锟斤拷效) Length 锟斤拷锟斤拷锟秸碉拷锟斤拷锟斤拷锟捷筹拷锟斤拷 (锟斤拷锟斤拷N_Result为N_OK时锟斤拷效)
N_Result �����ݵĽ��ս�� N_Result 锟斤拷锟斤拷锟捷的斤拷锟秸斤拷锟?
锟斤拷锟斤拷值锟斤拷锟斤拷 锟斤拷锟斤拷值锟斤拷锟斤拷
******************************************************************************/ ******************************************************************************/
void UDS_N_USData_Indication(uint32_t N_TAtype, uint8_t *MessageData, uint16_t Length, N_ResultEnum N_Result) void UDS_N_USData_Indication(uint32_t N_TAtype, uint8_t *MessageData, uint16_t Length, N_ResultEnum N_Result)
...@@ -124,7 +124,7 @@ void UDS_N_USData_Indication(uint32_t N_TAtype, uint8_t *MessageData, uint16_t L ...@@ -124,7 +124,7 @@ void UDS_N_USData_Indication(uint32_t N_TAtype, uint8_t *MessageData, uint16_t L
} }
/****************************************************************************** /******************************************************************************
�Ự���ϲ�ӿ� 锟结话锟斤拷锟较诧拷涌锟?
******************************************************************************/ ******************************************************************************/
/****************************************************************************** /******************************************************************************
...@@ -133,7 +133,7 @@ void UDS_N_USData_Indication(uint32_t N_TAtype, uint8_t *MessageData, uint16_t L ...@@ -133,7 +133,7 @@ void UDS_N_USData_Indication(uint32_t N_TAtype, uint8_t *MessageData, uint16_t L
The service primitive requests transmission of S_Data with S_Length The service primitive requests transmission of S_Data with S_Length
number of bytes from the sender to the receiver peer entities number of bytes from the sender to the receiver peer entities
identified by the address information in S_TAtype. identified by the address information in S_TAtype.
�� ����S_TAtype ���������ݵ�Ŀ���ַ 锟斤拷 锟斤拷锟斤拷S_TAtype 锟斤拷锟斤拷锟斤拷锟斤拷锟捷碉拷目锟斤拷锟街?
S_Data 锟斤拷锟斤拷锟酵碉拷锟斤拷锟斤拷 S_Data 锟斤拷锟斤拷锟酵碉拷锟斤拷锟斤拷
S_Length 锟斤拷锟斤拷锟捷的筹拷锟斤拷 S_Length 锟斤拷锟斤拷锟捷的筹拷锟斤拷
锟斤拷锟斤拷值锟斤拷锟斤拷 锟斤拷锟斤拷值锟斤拷锟斤拷
...@@ -146,12 +146,12 @@ void UDS_S_Data_Request(uint32_t S_TAtype, uint8_t *S_Data, uint16_t S_Length) ...@@ -146,12 +146,12 @@ void UDS_S_Data_Request(uint32_t S_TAtype, uint8_t *S_Data, uint16_t S_Length)
/****************************************************************************** /******************************************************************************
锟斤拷锟斤拷锟斤拷锟斤拷UDS_S_Data_Request 锟斤拷锟斤拷锟斤拷锟斤拷UDS_S_Data_Request
锟斤拷 锟杰o拷锟矫凤拷锟斤拷锟缴会话锟姐发锟斤拷,锟斤拷锟斤拷指锟斤拷锟斤拷S_TAtype为目锟斤拷锟街凤拷锟絊_Data.request锟斤拷锟斤拷锟斤拷锟斤拷 锟斤拷 锟杰o拷锟矫凤拷锟斤拷锟缴会话锟姐发锟斤拷,锟斤拷锟斤拷指锟斤拷锟斤拷S_TAtype为目锟斤拷锟街凤拷锟絊_Data.request锟斤拷锟斤拷锟斤拷锟斤拷
�Ƿ���� 锟角凤拷锟斤拷锟?
The S_Data.confirm service is issued by the session layer. The service The S_Data.confirm service is issued by the session layer. The service
primitive confirms the completion of an S_Data.request service primitive confirms the completion of an S_Data.request service
identified by the address information in S_TAtype. identified by the address information in S_TAtype.
�� ����S_TAtype ���������ݵ�Ŀ���ַ 锟斤拷 锟斤拷锟斤拷S_TAtype 锟斤拷锟斤拷锟斤拷锟斤拷锟捷碉拷目锟斤拷锟街?
S_Result �����ݵķ��ͽ�� S_Result 锟斤拷锟斤拷锟捷的凤拷锟酵斤拷锟?
锟斤拷锟斤拷值锟斤拷锟斤拷 锟斤拷锟斤拷值锟斤拷锟斤拷
******************************************************************************/ ******************************************************************************/
void UDS_S_Data_Confirm(uint32_t S_TAtype, S_Result_Enum S_Result) void UDS_S_Data_Confirm(uint32_t S_TAtype, S_Result_Enum S_Result)
...@@ -177,7 +177,7 @@ void UDS_S_Data_Confirm(uint32_t S_TAtype, S_Result_Enum S_Result) ...@@ -177,7 +177,7 @@ void UDS_S_Data_Confirm(uint32_t S_TAtype, S_Result_Enum S_Result)
锟斤拷 锟斤拷锟斤拷S_TAtype 锟斤拷锟斤拷锟秸碉拷锟斤拷锟斤拷锟捷碉拷址锟斤拷息 锟斤拷 锟斤拷锟斤拷S_TAtype 锟斤拷锟斤拷锟秸碉拷锟斤拷锟斤拷锟捷碉拷址锟斤拷息
S_Data 锟斤拷锟斤拷锟秸碉拷锟斤拷锟斤拷锟斤拷 (锟斤拷锟斤拷S_Result为S_OK时锟斤拷效) S_Data 锟斤拷锟斤拷锟秸碉拷锟斤拷锟斤拷锟斤拷 (锟斤拷锟斤拷S_Result为S_OK时锟斤拷效)
S_Length 锟斤拷锟斤拷锟秸碉拷锟斤拷锟斤拷锟捷筹拷锟斤拷 (锟斤拷锟斤拷S_Result为S_OK时锟斤拷效) S_Length 锟斤拷锟斤拷锟秸碉拷锟斤拷锟斤拷锟捷筹拷锟斤拷 (锟斤拷锟斤拷S_Result为S_OK时锟斤拷效)
S_Result �����ݵĽ��ս�� S_Result 锟斤拷锟斤拷锟捷的斤拷锟秸斤拷锟?
锟斤拷锟斤拷值锟斤拷锟斤拷 锟斤拷锟斤拷值锟斤拷锟斤拷
******************************************************************************/ ******************************************************************************/
void UDS_S_Data_Indication(uint32_t S_TAtype, uint8_t S_Data [], uint16_t S_Length, S_Result_Enum S_Result) void UDS_S_Data_Indication(uint32_t S_TAtype, uint8_t S_Data [], uint16_t S_Length, S_Result_Enum S_Result)
...@@ -269,11 +269,11 @@ void UDS_Process_Service_Request(void) ...@@ -269,11 +269,11 @@ void UDS_Process_Service_Request(void)
/****************************************************************************** /******************************************************************************
锟斤拷锟斤拷锟斤拷锟斤拷UDS_Service_Response 锟斤拷锟斤拷锟斤拷锟斤拷UDS_Service_Response
�� �ܣ��ú������ݷ�������������Ӧ�ķ������ݴ��ݸ��ͻ���,ͨ���ڸ�������ķ��� 锟斤拷 锟杰o拷锟矫猴拷锟斤拷锟斤拷锟捷凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷应锟侥凤拷锟斤拷锟斤拷锟捷达拷锟捷革拷锟酵伙拷锟斤拷,通锟斤拷锟节革拷锟斤拷锟斤拷锟斤拷姆锟斤拷锟?
锟斤拷 锟斤拷锟斤拷si 锟斤拷锟斤拷锟斤拷ID 锟斤拷 锟斤拷锟斤拷si 锟斤拷锟斤拷锟斤拷ID
RspType 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 POSITIVE_RSP 锟斤拷锟斤拷锟斤拷 RspType 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 POSITIVE_RSP 锟斤拷锟斤拷锟斤拷
NEGATIVE_RSP 锟斤拷锟斤拷锟斤拷 NEGATIVE_RSP 锟斤拷锟斤拷锟斤拷
A_TA_type ��Ŀ���ַ���� A_TA_type 锟斤拷目锟斤拷锟街凤拷锟斤拷锟?
A_Length 锟斤拷锟芥反锟斤拷携锟斤拷锟斤拷锟斤拷锟捷的筹拷锟斤拷(锟斤拷锟斤拷锟斤拷锟斤拷A_Data锟侥筹拷锟斤拷) A_Length 锟斤拷锟芥反锟斤拷携锟斤拷锟斤拷锟斤拷锟捷的筹拷锟斤拷(锟斤拷锟斤拷锟斤拷锟斤拷A_Data锟侥筹拷锟斤拷)
A_Data 锟斤拷锟芥反锟斤拷携锟斤拷锟斤拷锟斤拷锟斤拷 A_Data 锟斤拷锟芥反锟斤拷携锟斤拷锟斤拷锟斤拷锟斤拷
锟斤拷锟斤拷值锟斤拷锟斤拷 锟斤拷锟斤拷值锟斤拷锟斤拷
......
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