From bf685e699dac374e7536cb81ed7ca972d01e5861 Mon Sep 17 00:00:00 2001
From: guanjiao <sqrgj@163.com>
Date: 星期六, 15 九月 2018 18:16:51 +0800
Subject: [PATCH] AT指令发送写ID指令

---
 源码/核心板/Src/application/dw_app.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 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 822a810..64a0756 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"
@@ -26,6 +26,10 @@
 #include "dw_driver.h"
 #include "Spi.h"
 #include "led.h"
+#include "serial_at_cmd_app.h"
+#include "Usart.h"
+#include "global_param.h"
+#include "filters.h"
 
 
 /*------------------------------------ Marcos ------------------------------------------*/
@@ -127,6 +131,10 @@
 uint8_t random_delay_tim = 0;
 
 double distance, dist_no_bias, dist_cm;
+
+uint32_t g_UWB_com_interval = 0; 
+float dis_after_filter;				//当前距离值
+LPFilter_Frac* p_Dis_Filter;		//测距用的低通滤波器
 
 /*------------------------------------ Functions ------------------------------------------*/
 
@@ -333,7 +341,10 @@
 
 	/* Poll for reception of a frame or error/timeout. See NOTE 7 below. */
 	while (!((status_reg = dwt_read32bitreg(SYS_STATUS_ID)) & (SYS_STATUS_RXFCG | SYS_STATUS_ALL_RX_ERR)))//不断查询芯片状态直到接收成功或者出现错误
-	{ };
+	{ 
+		UART_CheckReceive();
+		UART_CheckSend();
+	};
 
 	if (status_reg & SYS_STATUS_RXFCG)//成功接收
 	{
@@ -430,7 +441,10 @@
 					dist_cm = dist_no_bias * 100; //dis 为单位为cm的距离
 //					dist[TAG_ID] = LP(dis, TAG_ID); //LP 为低通滤波器,让数据更稳定
 					
+					/*--------------------------以下为非测距逻辑------------------------*/
 					LED0_BLINK; //每成功一次通讯则闪烁一次
+					g_UWB_com_interval = 0;
+					dis_after_filter = LP_Frac_Update(p_Dis_Filter, dist_cm);
 
 				}
 			}

--
Gitblit v1.9.3