Browse Source

V0.0.1.10,取消UART0的写入

LAPTOP-KB7QFH2U\ChenJie-PC 2 years ago
parent
commit
bc18b039f0
2 changed files with 44 additions and 44 deletions
  1. 1 1
      code/app/AppGlobalVar.c
  2. 43 43
      code/app/AppTaskUart0.c

+ 1 - 1
code/app/AppGlobalVar.c

@@ -25,7 +25,7 @@ uint16 WebSitePort = 8812;
 #endif
 
 #define defaultSn "SPFPFL264S226D001"
-const uint32 AppSwVersion = 0x00000109;
+const uint32 AppSwVersion = 0x0000010A;
 
 const uint8 DataModuleType = 0x02;//01=NB,02-4G
 const uint16 HwVersion = 0x001;

+ 43 - 43
code/app/AppTaskUart0.c

@@ -70,49 +70,49 @@ void Uart0Task(void *pvParameters)
 		}
 		case PROCESS_UART_STATE_WRITE:
 		{
-			if (battSeparateEnable) //最多重新写5次
-			{
-				uint16 RegAddress = 0;
-				uint16 CRC_chk_buffer = 0;
-				uint8 WriteData[2] = {0x00, 0x00};
-				uint8 UartRecvBuffer[10];
-				if (!battSeparateCtlState)
-				{
-					WriteData[1] = 0x55;
-				}
-				else
-				{
-					WriteData[1] = 0xAA;
-				}
-				RegAddress = 100;
-				UartWriteMsgType Uart_Write_Msg;
-				Uart_Write_Msg.Bms_Address = BMS_ADDRESS_CODE;
-				Uart_Write_Msg.Bms_Funcode = UART_WRITE_CODE;
-				Uart_Write_Msg.Reg_Begin_H = RegAddress >> 8;
-				Uart_Write_Msg.Reg_Begin_L = RegAddress;
-				Uart_Write_Msg.Reg_Num_H = 0x00;
-				Uart_Write_Msg.Reg_Num_L = 0x01;
-				Uart_Write_Msg.Data_Count = 0x02; //要写入的字节数
-				memcpy(Uart_Write_Msg.Data, WriteData, 2);
-				CRC_chk_buffer = crc_chk((uint8 *)&Uart_Write_Msg, sizeof(Uart_Write_Msg) - 2);
-				Uart_Write_Msg.CRC_L = CRC_chk_buffer;
-				Uart_Write_Msg.CRC_H = CRC_chk_buffer >> 8;
-				UART_Query_Data(UART_LPUART0, UART_LPUART0, (uint8 *)&Uart_Write_Msg, sizeof(Uart_Write_Msg), UartRecvBuffer, &pReadLen, 500);
-				if (pReadLen > 3 && *(UartRecvBuffer + 1) == 0x10)
-				{
-					writecounter = 0;
-					battSeparateEnable = 0;
-				}
-				else
-				{
-					writecounter++;
-				}
-			}
-			if (writecounter >= 5)
-			{
-				battSeparateEnable = 0;
-				writecounter = 0;
-			}
+//			if (battSeparateEnable) //最多重新写5次
+//			{
+//				uint16 RegAddress = 0;
+//				uint16 CRC_chk_buffer = 0;
+//				uint8 WriteData[2] = {0x00, 0x00};
+//				uint8 UartRecvBuffer[10];
+//				if (!battSeparateCtlState)
+//				{
+//					WriteData[1] = 0x55;
+//				}
+//				else
+//				{
+//					WriteData[1] = 0xAA;
+//				}
+//				RegAddress = 100;
+//				UartWriteMsgType Uart_Write_Msg;
+//				Uart_Write_Msg.Bms_Address = BMS_ADDRESS_CODE;
+//				Uart_Write_Msg.Bms_Funcode = UART_WRITE_CODE;
+//				Uart_Write_Msg.Reg_Begin_H = RegAddress >> 8;
+//				Uart_Write_Msg.Reg_Begin_L = RegAddress;
+//				Uart_Write_Msg.Reg_Num_H = 0x00;
+//				Uart_Write_Msg.Reg_Num_L = 0x01;
+//				Uart_Write_Msg.Data_Count = 0x02; //要写入的字节数
+//				memcpy(Uart_Write_Msg.Data, WriteData, 2);
+//				CRC_chk_buffer = crc_chk((uint8 *)&Uart_Write_Msg, sizeof(Uart_Write_Msg) - 2);
+//				Uart_Write_Msg.CRC_L = CRC_chk_buffer;
+//				Uart_Write_Msg.CRC_H = CRC_chk_buffer >> 8;
+//				UART_Query_Data(UART_LPUART0, UART_LPUART0, (uint8 *)&Uart_Write_Msg, sizeof(Uart_Write_Msg), UartRecvBuffer, &pReadLen, 500);
+//				if (pReadLen > 3 && *(UartRecvBuffer + 1) == 0x10)
+//				{
+//					writecounter = 0;
+//					battSeparateEnable = 0;
+//				}
+//				else
+//				{
+//					writecounter++;
+//				}
+//			}
+//			if (writecounter >= 5)
+//			{
+//				battSeparateEnable = 0;
+//				writecounter = 0;
+//			}
 			PROC_UART0_STATE_SWITCH(PROCESS_UART_STATE_IDLE);
 			break;
 		}