From 200bbcc553cfb7c11b06058f3f13ca9247783e93 Mon Sep 17 00:00:00 2001
From: chen <15335560115@163.com>
Date: 星期四, 05 十二月 2024 18:27:50 +0800
Subject: [PATCH] 解决多设备丢包版本

---
 keil/include/main/main.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/keil/include/main/main.c b/keil/include/main/main.c
index 123f295..875e00f 100644
--- a/keil/include/main/main.c
+++ b/keil/include/main/main.c
@@ -64,6 +64,7 @@
 #define SLEEP_START_TIME 120
 uint8_t enable_sleep_count,sleep_flag;
 #define DEBUG_MODE
+
 struct UART_CFG_T test_uart_cfg =
 {
         .parity = UART_PARITY_NONE,
@@ -178,7 +179,7 @@
 group_id=g_com_map[GROUP_ID];
 memcpy(&dev_id ,&g_com_map[DEV_ID],2);
 tag_frequence=1000/g_com_map[COM_INTERVAL];	
-g_com_map[VERSION] = (1<<8)|2;
+g_com_map[VERSION] = (1<<8)|5;
 LOG_INFO(TRACE_MODULE_APP,"设备ID: %x .\r\n",dev_id);
 LOG_INFO(TRACE_MODULE_APP,"固件版本:UWB-标签 V%d.%d. \r\n",g_com_map[VERSION]>>8,g_com_map[VERSION]&0xff);
 }
@@ -250,7 +251,7 @@
     //sys_timer_open();
 		
     gpio_open();
-    //board_led_init();
+    board_led_init();
 		
 		 //uart_open(UART_ID0, &test_uart_cfg);
 		
@@ -262,9 +263,10 @@
 		//adc_open(&usr_adc_cfg);
 		//adc_get(&sample[0], NUM_SAMPLES, adc_callback);//adc采样
     // Enable sleep timer
+		Tag_uwb_init();
     sleep_timer_open(true, SLEEP_TIMER_MODE_RELOAD, sleep_timer_callback);
 		//sleep_timer_start(__MS_TO_32K_CNT(g_com_map[COM_INTERVAL]));//测试
-		sleep_timer_start(__MS_TO_32K_CNT(500));//测试
+		sleep_timer_start(__MS_TO_32K_CNT(SLEEP_COUNT));//测试
 		//board_5V_input_init(voltage_input_handler);//有修改3.3V会一直高电平导致无法进入休眠
 		#ifdef BOXING 
 				io_pin_mux_set(IO_PIN_5, IO_FUNC0);//波形测试
@@ -279,8 +281,9 @@
 			//LOG_INFO(TRACE_MODULE_APP, "测距ing");
 			
 			g_start_send_flag = 0;
-			
+			gpio_pin_set(LED_PIN);//亮
 			TagRange();
+			gpio_pin_clr(LED_PIN);//灭
 			IdleTask();	
 			}else{
 			IdleTask();	

--
Gitblit v1.9.3