Browse Source

版本号1.2.1.30,4830软件,新增:Can信息发送,测试使用

CHENJIE-PC\QiXiang_CHENJIE 3 years ago
parent
commit
8924992315
2 changed files with 9 additions and 7 deletions
  1. 4 4
      inc/app.h
  2. 5 3
      src/CANTask.c

+ 4 - 4
inc/app.h

@@ -15,8 +15,8 @@ extern "C" {
 //全局定义声明区
 #define BMS_MANUFACTURE (1) //BMS制造商表示1-超力源,2-美顺
 #define DATA_MODULE_TYPE (1) //1表示NB模块,2表示4G cat1
-//#define BAT4830
-#define BAT6060  //电池型号变化需要更改
+#define BAT4830
+//#define BAT6060  //电池型号变化需要更改
 #ifdef  BAT4830
     #define BATT_CELL_VOL_NUM  (14)
     #define BATT_TEMP_NUM  (3)
@@ -34,8 +34,8 @@ extern "C" {
 #define HWVERSION		    0x0102    //硬件主版本,现为V1.2板
 #define	BLSWVERSION		0x01020000    //BootLoader版本号V1.2.0.0
 #define	DRVSWVERSION		0x01040000     //驱动层版本号V1.4.0.0
-// #define	APPSWVERSION		0x0102011D     
-#define	APPSWVERSION		0x02000001
+#define	APPSWVERSION		0x0102011E     
+//#define	APPSWVERSION		0x02000001
 //--------------------------------------------------------------------------------
 
 #define APP_CONFIG_FILE_LATEST_VERSION 0

+ 5 - 3
src/CANTask.c

@@ -69,7 +69,7 @@ static void Can_Receive()
 	slpManSlpState_t State;
     uint8_t cnt,temp,udsFlag=0;
 	UINT8 i = 0;
-
+	CAN_Msg_Type CANSendBuffer ={0};
     while(true)
     {
 		memset(CanRxMsg, 0, sizeof(CanRxMsg));    		
@@ -111,9 +111,8 @@ static void Can_Receive()
 						UDS_Service();
 						udsFlag = 0;							
 					}
-					if(Timer_count%10==0&&UartReadMsg.len>0)
+					if(Timer_count%10==0)
 					{
-						CAN_Msg_Type CANSendBuffer ={0};
 						CANSendBuffer.Id = 0x7A9;
 						CANSendBuffer.DLC = 8;
 						CANSendBuffer.Data[0] = UartReadMsg.data[(0x19+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+BATT_OTHER_TEMP_NUM)*2+1];
@@ -124,7 +123,10 @@ static void Can_Receive()
 						CANSendBuffer.Data[5] = UartReadMsg.data[(0x0B+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+BATT_OTHER_TEMP_NUM)*2];
 						CANSendBuffer.Data[6] = 0x00;
 						CANSendBuffer.Data[7] = 0x00;
+						if(UartReadMsg.len>0)
+						{
 						HAL_Can_Transmit(CANSendBuffer);
+						}
 					}		
 					break;
 				}