Ô´Âë/ºËÐİå/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);
            }
         }