2
0

2 Commits ec73f9738c ... 1095daa169

Autor SHA1 Mensagem Data
  LAPTOP-KB7QFH2U\ChenJie-PC 1095daa169 V0.2.0.9 GPS测试更改 1 ano atrás
  LAPTOP-KB7QFH2U\ChenJie-PC 64c98ee242 V0.2.0.8 GPS状态测试 1 ano atrás
3 arquivos alterados com 15 adições e 11 exclusões
  1. 1 1
      code/app/AppGlobalVar.c
  2. 11 7
      code/app/AppTaskGps.c
  3. 3 3
      code/app/AppTaskUart1.c

+ 1 - 1
code/app/AppGlobalVar.c

@@ -39,7 +39,7 @@ AppConfigBody AppConfigInfo = {false, true, {defaultSn}, {0}};
 #endif
 
 //*全局变量*//
-const uint32 AppSwVersion = 0x00020007;
+const uint32 AppSwVersion = 0x00020009;
 const uint8 DataModuleType = 0x02; // 01=NB,02-4G
 const uint16 HwVersion = 0x0102;
 const uint32 BlSwVersion = 0x00000002;

+ 11 - 7
code/app/AppTaskGps.c

@@ -16,6 +16,8 @@ uint8 GpsRecvPtr[1024];
 uint32 timerCounterGetdata = 0;
 uint32 ledCounterTmp = 0;
 uint32 triaxiCounterTmp = 0;
+
+char gpsTestBuffer[20];
 static void vtimerCallback(TimerHandle_t pxTimer)
 {
 	uint32 ulTimerID;
@@ -40,7 +42,7 @@ void GpsTask(void *pvParameters)
 	uint8 fftIdx = 0;
 	uint16 GpsErrCounter = 0;
 	uint16 GpsRestartCounter = 0;
-	bool GpsPwrDownFlg = false;
+	volatile bool GpsPwrDownFlg = false;
 	while(1)
 	{
 		memset(GpsRecvPtr,0,sizeof(GpsRecvPtr));
@@ -57,6 +59,7 @@ void GpsTask(void *pvParameters)
 			}
 			else
 			{
+				GpsErrCounter+=1;
 				if(GpsErrCounter>60*10)
 				{
 					Dio_WriteChannel(DioConf_DioChannel_PTD1_GPIO_OUT_MCU_GPS_POW_EN, STD_OFF);//GPS关机
@@ -64,13 +67,13 @@ void GpsTask(void *pvParameters)
 					GpsPwrDownFlg = true;
 					GpsRestartCounter = 0;
 				}
-				if(GpsPwrDownFlg)
-				{
-					GpsRestartCounter+=1;
-				}
-				GpsErrCounter+=1;
 			}
-			if(GpsRestartCounter>10)
+
+			if(GpsPwrDownFlg)
+			{
+				GpsRestartCounter+=1;
+			}
+			if(GpsRestartCounter>30)
 			{
 				GpsRestartCounter = 0;
 				GpsPwrDownFlg = false;
@@ -132,6 +135,7 @@ void GpsDataDecode(uint8 *msg)
 	uint32 latitude;
 	uint32 longitude;
 	uint16 direction;
+	memcpy(gpsTestBuffer,msg,19);
 	memset((uint8 *)&GpsInfoData, 0x00, sizeof(GPSInfo));
 	p = strtok(msg, delim); //将信息进行分割
 	p2 = strtok(NULL, delim);

+ 3 - 3
code/app/AppTaskUart1.c

@@ -966,6 +966,7 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
 	}
 	case DebugMsg:
 	{
+		extern char gpsTestBuffer[20];
 		char rbuf[512]={0};
 		char tmp[13] = {0};
 		memcpy(tmp,BMS_SN,12);
@@ -977,7 +978,7 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
 								{%.2f,%.2f,%.2f,%.2f,%.2f;\
 								%.2f,%.2f,%.2f,%.2f,%.2f,}\
 								{%.2f,%.2f,%.2f,%.2f,%.2f;\
-								%.2f,%.2f,%.2f,%.2f,%.2f,},%s,%d-M-%d,P-%d,N-%d,C-%d,A-%d",
+								%.2f,%.2f,%.2f,%.2f,%.2f,},%s,%d,%s",
 				returnFreq[0][0], returnFreq[0][1], returnFreq[0][2], returnFreq[0][3], returnFreq[0][4],
 				returnP[0][0], returnP[0][1], returnP[0][2], returnP[0][3], returnP[0][4],
 
@@ -985,8 +986,7 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
 				returnP[1][0], returnP[1][1], returnP[1][2], returnP[1][3], returnP[1][4],
 
 				returnFreq[2][0], returnFreq[2][1], returnFreq[2][2], returnFreq[2][3], returnFreq[2][4],
-				returnP[2][0], returnP[2][1], returnP[2][2], returnP[2][3], returnP[2][4],tmp,DeviceErrNum,
-				BMS_Mode,BMS_StPosRly,BMS_StNegRly,BMS_CharSt,BMS_PackCurr-10000);
+				returnP[2][0], returnP[2][1], returnP[2][2], returnP[2][3], returnP[2][4],tmp,DeviceErrNum,gpsTestBuffer);
 
 		BufferLen = strlen((const char *)rbuf);
 		*SendLen = BufferLen + sizeof(DebugMsgInfo);