Browse Source

V1 版本GPS测试结束,rest 脚状态不确定导致gps重启,v1版未进行修改,现改为v2版测试gps

CHENJIE-PC\QiXiang_CHENJIE 4 years ago
parent
commit
141083b13a
2 changed files with 16 additions and 8 deletions
  1. 3 3
      src/app.c
  2. 13 5
      src/hal_module_adapter.c

+ 3 - 3
src/app.c

@@ -25,7 +25,7 @@
 //空间及变量定义
 //空间及变量定义
 #define PROC_MAIN_TASK_STACK_SIZE           (2048)
 #define PROC_MAIN_TASK_STACK_SIZE           (2048)
 #define PROC_UART_TASK_STACK_SIZE           (1024)
 #define PROC_UART_TASK_STACK_SIZE           (1024)
-#define PROC_CAN_TASK_STACK_SIZE           (1024)
+#define PROC_CAN_TASK_STACK_SIZE           (1024*2)
 #define PROC_TCP_TASK_STACK_SIZE           (2048)
 #define PROC_TCP_TASK_STACK_SIZE           (2048)
 #define APP_EVENT_QUEUE_SIZE    (10)
 #define APP_EVENT_QUEUE_SIZE    (10)
 uint8_t deepslpTimerID          = DEEPSLP_TIMER_ID7;
 uint8_t deepslpTimerID          = DEEPSLP_TIMER_ID7;
@@ -56,7 +56,7 @@ volatile uint8_t Tcp_statuts = 0;
 uint8_t Batt_Cell_Num = 14;//默认数值14、17
 uint8_t Batt_Cell_Num = 14;//默认数值14、17
 uint8_t Batt_Cell_Num_2 ;//默认数值
 uint8_t Batt_Cell_Num_2 ;//默认数值
 uint8_t Batt_Temp_Num = 5;//默认数值5、7
 uint8_t Batt_Temp_Num = 5;//默认数值5、7
-CHAR SN[] = "GYTEST00000000002";//SN应写到osfile里面
+CHAR SN[] = "GYTEST00000000004";//SN应写到osfile里面
 
 
 int16_t Uart_Rece_BattI=0x0000;
 int16_t Uart_Rece_BattI=0x0000;
 uint8_t Can_Rece_buffer[8];
 uint8_t Can_Rece_buffer[8];
@@ -749,7 +749,7 @@ static void Can_Task(void* arg)
                     printf("Gpsmsgqueue: %d,%d,%d,%d\r\n",Gps_Data.latitude,Gps_Data.longitude,Gps_Data.speed,Gps_Data.direction);
                     printf("Gpsmsgqueue: %d,%d,%d,%d\r\n",Gps_Data.latitude,Gps_Data.longitude,Gps_Data.speed,Gps_Data.direction);
                 #endif 
                 #endif 
                 #ifdef BL_FILE_LOG
                 #ifdef BL_FILE_LOG
-	                bluejoy_printf(BL_LEVEL3,"Gpsmsgqueue: %d,%d,%d,%d\r\n",Gps_Data.latitude,Gps_Data.longitude,Gps_Data.speed,Gps_Data.direction);
+	                bluejoy_printf(BL_LEVEL3,"Gpsmsg: %d,%d,%d,%d\r\n",Gps_Data.latitude,Gps_Data.longitude,Gps_Data.speed,Gps_Data.direction);
                 #endif
                 #endif
                 //can采用先接收后发送的策略
                 //can采用先接收后发送的策略
                 HAL_Can_Receive(Can_Rece_buffer);
                 HAL_Can_Receive(Can_Rece_buffer);

+ 13 - 5
src/hal_module_adapter.c

@@ -2032,9 +2032,6 @@ static void GpsProcess(void* arg)
 			#ifdef USING_PRINTF	
 			#ifdef USING_PRINTF	
 				printf("\nP msgptr data:%s\r\n",p);
 				printf("\nP msgptr data:%s\r\n",p);
 			#endif
 			#endif
-			#ifdef BL_FILE_LOG
-	            bluejoy_printf(BL_LEVEL3,"\nP msgptr data:%s\r\n",p);
-            #endif
 			int i=0;
 			int i=0;
 			p = strtok(p,",");//只取第1行的信息RMC
 			p = strtok(p,",");//只取第1行的信息RMC
 			//p = strtok(temp,",");//模拟测试
 			//p = strtok(temp,",");//模拟测试
@@ -2081,8 +2078,15 @@ static void GpsProcess(void* arg)
 						Gps_buffer.direction = atol(databuffer[8]);
 						Gps_buffer.direction = atol(databuffer[8]);
 					}
 					}
 					Gps_buffer.direction = 0xfffe;
 					Gps_buffer.direction = 0xfffe;
+					#ifdef BL_FILE_LOG
+					bluejoy_printf(BL_LEVEL3,"\nGpsdata valide:");
+					for (int i = 0; i < sizeof(databuffer); i++)
+					{
+						bluejoy_printf(BL_LEVEL3,"%s---",databuffer[i]);
+					}
+            		#endif
+					osMessageQueuePut(gpsMsgQueue, &Gps_buffer, 0, 1000);
 				}
 				}
-				osMessageQueuePut(gpsMsgQueue, &Gps_buffer, 0, 1000);
 			}
 			}
 			free(msgtemp);
 			free(msgtemp);
 			msgtemp=NULL;
 			msgtemp=NULL;
@@ -2091,7 +2095,11 @@ static void GpsProcess(void* arg)
 		
 		
 		if (Sleep_Flag)
 		if (Sleep_Flag)
 		{
 		{
-			osThreadExit();
+			// osThreadExit();
+			while (true)
+			{
+				osDelay(10000);
+			}
 			break;
 			break;
 		}
 		}
     }
     }