Browse Source

版本号为2.0.0.3,新增:Can信息发送,6060温度编号更改,增加了互斥锁,整合了V2集成修改点。

CHENJIE-PC\QiXiang_CHENJIE 3 năm trước cách đây
mục cha
commit
feac9a79d8
2 tập tin đã thay đổi với 8 bổ sung6 xóa
  1. 5 5
      inc/app.h
  2. 3 1
      src/CANTask.c

+ 5 - 5
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)
@@ -24,7 +24,7 @@ extern "C" {
     #define BATT_OTHER_TEMP_NUM  (2)
 #elif defined BAT6060
     #define BATT_CELL_VOL_NUM  (17)
-    #define BATT_TEMP_NUM  (5)
+    #define BATT_TEMP_NUM  (4)
     #define BMS_INFO  (2)       //2-BMS信息表示6060
     #define BATT_OTHER_TEMP_NUM  (2)
 #endif
@@ -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		0x0102011E     
-//#define	APPSWVERSION		0x02000001
+//#define	APPSWVERSION		0x0102011E     
+#define	APPSWVERSION		0x02000003
 //--------------------------------------------------------------------------------
 
 #define APP_CONFIG_FILE_LATEST_VERSION 0

+ 3 - 1
src/CANTask.c

@@ -23,7 +23,7 @@
 #include "CANTask.h"
 #include "UDSService.h"
 
-
+extern osMutexId_t UartMutex;
 extern UINT32 Timer_count;
 extern volatile bool Sleep_flag;
 extern UartReadMsgType UartReadMsg;
@@ -113,6 +113,7 @@ static void Can_Receive()
 					}
 					if(Timer_count%10==0)
 					{
+						osMutexAcquire(UartMutex, osWaitForever);
 						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];
@@ -127,6 +128,7 @@ static void Can_Receive()
 						{
 						HAL_Can_Transmit(CANSendBuffer);
 						}
+						osMutexRelease(UartMutex); 
 					}		
 					break;
 				}