zhyinch
2019-12-20 32fa4a5edfbd06a3c0be40a2f3890aae2c1a4d23
Ô´Âë/ºËÐİå/Src/application/dw_app.c
@@ -543,7 +543,7 @@
         /* Write and send the response message. See NOTE 9 below.*/
         if(tag_id_recv-TAG_ID_START<=TAG_NUM_IN_SYS)
         memcpy(&tx_resp_msg[DIST_IDX], &anchor_dist_last_frm[tag_id_recv-TAG_ID_START], 4);
         memcpy(&tx_resp_msg[DIST_IDX], &g_Tagdist[tag_id_recv], 4);
      
         dwt_writetxdata(sizeof(tx_resp_msg), tx_resp_msg, 0);//写入发送数据
         dwt_writetxfctrl(sizeof(tx_resp_msg), 0);//设定发送长度
@@ -615,8 +615,8 @@
               /*--------------------------以下为非测距逻辑------------------------*/
               LED0_BLINK; //每成功一次通讯则闪烁一次
               g_UWB_com_interval = 0;
               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;
               if(hex_dist-anchor_dist_last_frm[tag_id_recv-TAG_ID_START]<15000||misdist_num>4)
               {int32_t filter_dist;
                  misdist_num=0;
@@ -626,12 +626,11 @@
                  {
               if(abs(hex_dist-his_dist[tag_id_recv-TAG_ID_START])<10000)
               {
                  g_Tagdist[tag_id_recv-TAG_ID_START] = hex_dist;
                  anchor_dist_last_frm[tag_id_recv-TAG_ID_START] = hex_dist;
                  //anchor_dist_last_frm[tag_id_recv-TAG_ID_START] = hex_dist;
                  
                  #ifdef TDFILTER
                  TrackingDiffUpdate(pUWBDistanceTrackingDiff, (float)hex_dist);
                  filter_dist=pUWBDistanceTrackingDiff->pos_predict/10;
                  NewTrackingDiffUpdate(tag_id_recv-TAG_ID_START, (float)hex_dist);
                  filter_dist=pos_predict[tag_id_recv-TAG_ID_START]/10;
                  #else
                  filter_dist=hex_dist/10;
                  #endif
@@ -664,8 +663,7 @@
               }else{
                  misdist_num++;
               }
            if(anchor_dist_last_frm[tag_id_recv-TAG_ID_START]>1000)
            {anchor_dist_last_frm[tag_id_recv-TAG_ID_START]=anchor_dist_last_frm[tag_id_recv-TAG_ID_START];}
            }
         }else{
            /* Clear RX error events in the DW1000 status register. */