From 7e864f1d0b26f0e5dd4c073f8fe764eb286fe961 Mon Sep 17 00:00:00 2001
From: zhyinch <zhyinch@gmail.com>
Date: 星期四, 06 五月 2021 12:59:59 +0800
Subject: [PATCH] 回退V1.41 无滤波

---
 源码/核心板/Src/application/dw_app.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 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 767770f..3d19917 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"
@@ -1,6 +1,6 @@
 #include "dw_app.h"
 #include "ADC.h"
-#define TDFILTER
+//#define TDFILTER
 enum enumtagstate
 {
 	DISCPOLL,
@@ -449,6 +449,7 @@
 									memcpy(&rec_tagpos_binary,&rx_buffer[NEARMSG_EMPTYSLOTPOS_INDEX],4);
 								if(temp_dist!=0x1ffff)
 									{
+										g_Resttimer=0;
 										#ifndef USART_INTEGRATE_OUTPUT
 										usart_send[2] = 1;//正常模式
 										usart_send[3] = 17;//数据段长度
@@ -700,7 +701,6 @@
 {
 	//LED0_ON;
 	dwt_forcetrxoff();
-	g_Resttimer=0;
 		GPIO_WriteBit(GPIOA, GPIO_Pin_10, Bit_SET);	
 	switch(tag_state)
 	{
@@ -922,13 +922,14 @@
 					/*--------------------------以下为非测距逻辑------------------------*/
 					//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];
+					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])<10000||misdist_num[taglist_pos]>3)
 					{
 						int32_t filter_dist;
 						#ifdef TDFILTER
@@ -1009,8 +1010,7 @@
 //				if (anchor_type == rx_buffer[ANC_TYPE_IDX])
 //				Anchor_RecPoll();
 //				break;
-			case SYNC:		
-				g_Resttimer=0;				
+			case SYNC:					
 				memcpy(&rec_syncid,&rx_buffer[ANCHOR_ID_IDX],4);
 				if(rec_syncid<current_syncid)
 				{
@@ -1051,9 +1051,10 @@
 				}
 				break;
 		
-			case NEAR_POLL:		
-				g_Resttimer=0;				
+			case NEAR_POLL:						
 				memcpy(&tag_id_recv,&rx_buffer[TAG_ID_IDX],2);
+			if(tag_id_recv>=g_com_map[WHITELIST1_START]&&tag_id_recv<=g_com_map[WHITELIST1_END])
+			{break;}
 				taglist_pos=CmpTagInList(tag_id_recv);
 				if(taglist_pos==taglist_num)
 				{

--
Gitblit v1.9.3