From b32910bdb85c6e9d19abf97f1465c573a0bf9d38 Mon Sep 17 00:00:00 2001
From: zhangbo <zhangbo@qq.com>
Date: 星期四, 13 二月 2025 14:06:13 +0800
Subject: [PATCH] 测试版

---
 keil/uwb_app.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/keil/uwb_app.c b/keil/uwb_app.c
index 9fc1032..e87b03c 100644
--- a/keil/uwb_app.c
+++ b/keil/uwb_app.c
@@ -358,7 +358,7 @@
     while(mac_is_busy());
     gpio_pin_clr(SCL_PIN);
 }
-uint16_t uwb_searchcount,range_timeout_us = 1700;
+uint16_t uwb_searchcount,range_timeout_us = 2000;
 uint8_t flag_recsuccess;
 
 extern uint8_t g_start_send_flag,search_open_flag = 1,link_success_flag;
@@ -370,7 +370,7 @@
 uint32_t UWB_shoudao_count=0;
 uint32_t UWB_fachu_count=0;
 uint32_t UWB_qiangzhanfachu_count=0;
-
+uint32_t UWB_1003_count,UWB_6666_count=0;
 int UwbRange(void)
 {
     uint8_t i;
@@ -404,7 +404,7 @@
 //    temp_count3=phy_timer_count_get();
     //gpio_pin_set(SCL_PIN);
 		time_count_dkjs=phy_timer_count_get();
-		gpio_pin_set(IO_PIN_5);//测试
+//		gpio_pin_set(IO_PIN_5);//测试
 //		gpio_pin_clr(IO_PIN_5);
     uwb_rxflag=uwb_rx(0, 0, range_timeout_us);//开启接收
 //		gpio_pin_clr(IO_PIN_5);//测试
@@ -442,7 +442,7 @@
 		time_count_sdsj=phy_timer_count_get();
 			UWB_shoudao_count++;
 //					gpio_pin_set(IO_PIN_5);//测试
-		gpio_pin_clr(IO_PIN_5);
+//		gpio_pin_clr(IO_PIN_5);
 		#ifdef DEBUG_BOXING
 //		gpio_pin_set(IO_PIN_5);//测试
 //		gpio_pin_clr(IO_PIN_5);//测试
@@ -462,6 +462,7 @@
 					  //rec_nearbase_num=25;  
 					
             memcpy(&tag_id_recv,&rx_buf[TAG_ID_IDX],2);
+	
             memcpy(rec_ancidlist,&rx_buf[FZ_NEARBASEID_INDEX],2*rec_nearbase_num);
             memcpy(rec_ancdistlist,&rx_buf[FZ_NEARBASEID_INDEX+2*rec_nearbase_num],2*rec_nearbase_num);
             memcpy(&rec_antdelay,&rx_buf[FZ_NEARBASEID_INDEX+rec_nearbase_num*4],2);
@@ -473,6 +474,14 @@
                 {
                     rec_ancdistlist[i]+=(int16_t)g_com_map[DIST_OFFSET];
                     PushAnchorDataArray(tag_id_recv,rec_ancdistlist[i],battary);
+										if(tag_id_recv==0x1003)
+										{
+											UWB_1003_count++;
+										}
+										else if(tag_id_recv==0x6666)
+										{
+										UWB_6666_count++;
+										}
 									  UWB_fachu_count++;
 //		#ifdef DEBUG_BOXING
 ////		gpio_pin_clr(IO_PIN_5);//测试
@@ -508,7 +517,7 @@
       //  uwb_rxflag=uwb_rx(0, 0, range_timeout_us);
     }    
 		#ifdef DEBUG_BOXING
-		gpio_pin_clr(IO_PIN_5);//测试
+//		gpio_pin_clr(IO_PIN_5);//测试
 //		gpio_pin_set(IO_PIN_5);//测试
 		#endif
 	

--
Gitblit v1.9.3