Przeglądaj źródła

1.生成日期更新为20221125;
2.实现补传数据帧头校验,丢弃非法数据;

libo 2 lat temu
rodzic
commit
692102acda

+ 2 - 2
Inc/main.h

@@ -63,8 +63,8 @@ extern "C" {
 #include <stdlib.h>
 #include "stm32f7xx_hal.h"
 
-#define REMOTE_IAP_UPDATA 		0 	//是否是远程升级
-#define WATCH_DOG_ON 					0   //是否打开看门狗 //0----关闭看门狗SP706   1----打开看门狗SP706
+#define REMOTE_IAP_UPDATA 		1 	//是否是远程升级
+#define WATCH_DOG_ON 					1   //是否打开看门狗 //0----关闭看门狗SP706   1----打开看门狗SP706
 #define USE_RAM_RECORD    		1   //是否启用RAM数据缓存重发机制
 #define USE_QUEUE_RECORD			1   //是否启用队列数据缓存重发机制
 

+ 1 - 1
Src/KeySlave485.c

@@ -38,7 +38,7 @@ uint8_t product_code[20] = "JL-SIMS-CJ-V2.1";				 //
 uint8_t product_ID[20] = "20210730001";						 //产品ID
 
 char Version_software[30] = "KZB09A0_20220210_Temp1";
-uint32_t Version_Soft[8] = {2,2,3,13,1,1,0,20221111};
+uint32_t Version_Soft[8] = {2,2,3,13,1,1,0,20221125};
 
 uint8_t flag_exitReset = 0;	 //终止复位命令
 uint8_t flag_Uart4_Busy = 0; //表明打印机占用了总线,暂停语音播报

+ 5 - 0
Src/TerminalSlave485_jt808.c

@@ -691,6 +691,11 @@ void jt808_recv_func_DataBack(uint8_t * buf ,uint8_t len)
 		{
 			memset((void *)&(jt808_obj.send_data), 0x00, sizeof(jt808_obj.send_data));
 		}
+		else if( jt808_obj.send_data.buf[0] != JT808_FRAM_HEAD_ID)
+		{
+			memset((void *)&(jt808_obj.send_data), 0x00, sizeof(jt808_obj.send_data));
+		}
+
 		
 		//如果本帧数据重发次数大于5,则清除本帧数据
 		if(jt808_obj.send_data.send_cnt > 5)

+ 4 - 4
Src/freertos.c

@@ -79,7 +79,7 @@
 
 /* Private typedef -----------------------------------------------------------*/
 /* USER CODE BEGIN PTD */
-
+#define	DEBUG_FREERTOS_TASK 	0
 /* USER CODE END PTD */
 
 /* Private define ------------------------------------------------------------*/
@@ -455,7 +455,7 @@ void MX_FREERTOS_Init(void)
 	/* Create the thread(s) */
 	/* definition and creation of Uart_Comm */
 	//osThreadDef(Uart_Comm, Task_Usart_GetAllSensorData, osPriorityAboveNormal, 0, 512);
-#if 0
+#if DEBUG_FREERTOS_TASK==0
 	osThreadDef(Uart2_Comm, Task_Usart2_Collector, osPriorityAboveNormal, 0, 512 * 2); //20200106Àîΰ¸ü¸Ä
 	Uart2_CommHandle = osThreadCreate(osThread(Uart2_Comm), NULL);
 
@@ -465,12 +465,12 @@ void MX_FREERTOS_Init(void)
 
 #if	USE_RFS_RECORD==1	
 	
-		osThreadDef(task_record, func_record_queue_main, osPriorityBelowNormal, 0, 512 * 16);
+		osThreadDef(task_record, func_record_queue_main, osPriorityNormal, 0, 512 * 16);
 		task_record_Handle = osThreadCreate(osThread(task_record), NULL);
 #endif	
 
 	
-#if 0
+#if DEBUG_FREERTOS_TASK==0
 	/* definition and creation of Data_Process */
 	osThreadDef(Data_Process, Task_Usart3_LCD_Update, osPriorityNormal, 0, 512 * 4);
 	Data_ProcessHandle = osThreadCreate(osThread(Data_Process), NULL);

+ 16 - 8
func/func_queue_record.c

@@ -24,7 +24,7 @@
 
 /* Private macro------------------------------------------------------------------------------*/
 
-#define DEBUG_RECORD_QUEUE_EN   1
+#define DEBUG_RECORD_QUEUE  0
 
 /* Private typedef----------------------------------------------------------------------------*/
 
@@ -39,7 +39,7 @@ typedef struct queue_record_object
 {
 	uint8_t 	link_ok; 				//用于标识当前状态是1:读取,0:写入;
 	uint8_t   flash_ok;					//存储器状态标志
-	uint32_t 	cnt;
+	uint32_t 	running;
 	uint32_t 	wr_idx;
 	uint32_t 	msg_cnt;
 	uint32_t 	wr_cnt;
@@ -66,7 +66,7 @@ void func_record_queue_test(void)
 	
 	UNUSED(data);
 	
-	//sprintf(queue_record_obj.buf,"XX%02xXX",queue_record_obj.cnt%0x100);
+	//sprintf(queue_record_obj.buf,"XX%02xXX",queue_record_obj.running%0x100);
 	switch(queue_record_obj.opt_flag)
 	{
 		case 0:
@@ -420,9 +420,9 @@ void func_record_queue_main(void const *argument)
 	
 	while(1)
 	{
-		queue_record_obj.cnt++;
+		queue_record_obj.running++;
 		
-		if(queue_record_obj.cnt%(60) == 0)
+		if(queue_record_obj.running%(60) == 0)
 		{
 			if(func_w25q_stat() == false)			//读取FLASH ID,如果ID异常,则说明FLASH状态异常
 			{
@@ -437,13 +437,21 @@ void func_record_queue_main(void const *argument)
 			func_record_queue_cnt();
 			
 			func_record_queue_work();	
-		}
-#if  DEBUG_RECORD_QUEUE_EN==1		
+			
+#if  DEBUG_RECORD_QUEUE==1		
 		func_record_queue_test();			
 		osDelay(10);
 #else
 		osDelay(1000);
-#endif		
+#endif					
+			
+		}
+		else
+		{
+			osDelay(10000);
+		}
+		
+
 	}
 	
 

+ 2 - 2
obj/obj_hal_w25qxx.c

@@ -35,7 +35,7 @@ void W25QXX_CS_HIGH(void)
 		HAL_GPIO_TogglePin(GPIOC, DWI_Pin); //¿´ÃŹ·sp706
 	}
 	HAL_GPIO_WritePin(W25QXX_CS_GPIO, W25QXX_CS_PIN, GPIO_PIN_SET);
-	delay_us(1);
+	//delay_us(1);
 }
 void W25QXX_CS_LOW(void)
 {
@@ -44,7 +44,7 @@ void W25QXX_CS_LOW(void)
 		HAL_GPIO_TogglePin(GPIOC, DWI_Pin); //¿´ÃŹ·sp706
 	}
 	HAL_GPIO_WritePin(W25QXX_CS_GPIO, W25QXX_CS_PIN, GPIO_PIN_RESET);
-	delay_us(1);
+	//delay_us(1);
 }
 
 void W25QXX_CS_INIT(void)