From 8bdb1862ff536d661cb0f1d6de46b623d17580f9 Mon Sep 17 00:00:00 2001
From: zhyinch <zhyinch@gmail.com>
Date: 星期四, 15 四月 2021 11:11:53 +0800
Subject: [PATCH] V1.46 SFD模式改成1

---
 源码/核心板/Src/application/dw_app.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c"
index 61f1291..f4287d6 100644
--- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c"
+++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c"
@@ -14,7 +14,7 @@
 	DWT_PAC8,        /* Preamble acquisition chunk size. Used in RX only. */
 	9,               /* TX preamble code. Used in TX only. */
 	9,               /* RX preamble code. Used in RX only. */
-	0,               /* Use non-standard SFD (Boolean) */
+	1,               /* Use non-standard SFD (Boolean) */
 	DWT_BR_6M8,      /* Data rate. */
 	DWT_PHRMODE_STD, /* PHY header mode. */
 	(129 + 8 - 8)    /* SFD timeout (preamble length + 1 + SFD length - PAC size). Used in RX only. */
@@ -457,6 +457,7 @@
 								if(temp_dist!=0x1ffff)
 									{
 										g_Resttimer=0;
+                                        IWDG_Feed();
 										#ifdef USART_SINGLE_OUTPUT
 										usart_send[2] = 1;//正常模式
 										usart_send[3] = 17;//数据段长度
@@ -828,6 +829,7 @@
 				dwt_write32bitreg(SYS_STATUS_ID, SYS_STATUS_ALL_RX_ERR);
 			}
 }
+extern u16 dist_threshold;
 u8 misdist_num[TAG_NUM_IN_SYS],seize_anchor,getrange_success=0;
 u8 Anchor_RecNearPoll(u8 ancrec_nearbasepos) //0 mainbase  1 first near_base
 {
@@ -924,16 +926,18 @@
 					/*--------------------------以下为非测距逻辑------------------------*/
 					//dist_cm=33000;
 					getrange_success = 1;
-					g_Resttimer=0;
+					
 					LED0_BLINK; //每成功一次通讯则闪烁一次
 					dis_after_filter=dist_cm;
 					hex_dist = dist_cm+(int16_t)g_com_map[DIST_OFFSET]*10;
 					g_flag_Taggetdist[taglist_pos]=0;
-					if(hex_dist>-10000&&hex_dist<2000000)
+					if(hex_dist>0&&hex_dist<2000000)
 					{
-					if(abs(hex_dist-his_dist[taglist_pos])<15000||misdist_num[taglist_pos]>3)
+					if(abs(hex_dist-his_dist[taglist_pos])<dist_threshold||misdist_num[taglist_pos]>3)
 					{
 						int32_t filter_dist;
+                        g_Resttimer=0;
+                        IWDG_Feed();
 						#ifdef TDFILTER
 						NewTrackingDiffUpdate(taglist_pos, (float)hex_dist);
 						filter_dist=pos_predict[taglist_pos]/10;

--
Gitblit v1.9.3