From baf8b42fca25208021259fde69eabdd2fc31cefa Mon Sep 17 00:00:00 2001
From: WXK <287788329@qq.com>
Date: 星期六, 25 三月 2023 18:38:23 +0800
Subject: [PATCH] 阶段性调试1

---
 Src/application/dw_app.c |   34 +++++++++++++++++++++-------------
 1 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/Src/application/dw_app.c b/Src/application/dw_app.c
index 757921b..aa689a3 100644
--- a/Src/application/dw_app.c
+++ b/Src/application/dw_app.c
@@ -825,12 +825,7 @@
 
 	recbase_num=0;
 //	motor_state=0;
-    if(motor_state!=0&&motor_state!=3)
-    {
-        motor_flag = 1;
-    }else{
-        motor_flag = 0;
-    }
+
 	
 	tx_near_msg[BATTARY_IDX] = bat_percent;
 	tx_near_msg[BUTTON_IDX] = userkey_state|stationary_flag<<1|gotosleep_flag<<2|motor_flag<<5;
@@ -968,8 +963,7 @@
 									mainbase_dist=temp_dist;
                                     nearbase_distlist[0] = temp_dist;
                                     base_mindist = temp_dist;
-									if((rx_buffer[MOTORSTATE_INDEX]&0xf)!=3)
-										motor_state=rx_buffer[MOTORSTATE_INDEX]&0xf;
+
                                     if(frame_len==28)
                                      {
                                          memcpy(&rec_maxrangelen,&rx_buffer[MAXRANGE_DISTANCE],2);
@@ -1233,17 +1227,17 @@
 								}
 							}
 }
+extern void FZNearPoll(void);
 u32 id,error_times=0;
-
+u8 ttt = 1;
 extern float Height;
-void Tag_App(void)//发送模式(TAG标签)
+void UWBWkWp(void)
 {
-	static uint8_t diccount = 0;
-	//LED0_ON;
 	SPIx_CS_GPIO->BRR = SPIx_CS;
 	delay_us(700);
 	SPIx_CS_GPIO->BSRR = SPIx_CS;
 	id =  dwt_readdevid() ;
+    
 	    while (DWT_DEVICE_ID != id) 
     {
 		//	Dw1000_Init();
@@ -1256,6 +1250,16 @@
         }
     }
     error_times = 0;
+}
+void Tag_App(void)//发送模式(TAG标签)
+{
+	static uint8_t diccount = 0,diccount2;
+	//LED0_ON;
+    UWBWkWp();
+            if(0)
+        {
+             FZNearPoll();
+        }else{
 	switch(tag_state)
 	{
 		case REGPOLL:
@@ -1299,7 +1303,11 @@
         case SINGLEPOLL:
           //  Poll();
             break;
-	}
+	}}
+        
+ FZNearPoll();
+
+    dwt_forcetrxoff();
      userkey_state = !GET_USERKEY;
 	dwt_entersleep();
 }

--
Gitblit v1.9.3