keil/dw_tag.c
@@ -65,7 +65,7 @@
//    }
//}
// ts_a - ts_b
int64_t ranging_timestamp_diff(int64_t ts_a, int64_t ts_b)
int64_t ranging_timestamp_diff1(int64_t ts_a, int64_t ts_b)
{
    if (ts_a < ts_b)
    {
@@ -87,7 +87,7 @@
         //temp_freq_offset=freq_offset_filter;//测试
         memcpy(&resp_tx_timestamp,&anc_resptx[i],4);
         memcpy(&poll_rx_timestamp,&anc_pollrx[i],4);
         treply = ranging_timestamp_diff(resp_tx_timestamp, poll_rx_timestamp);
         treply = ranging_timestamp_diff1(resp_tx_timestamp, poll_rx_timestamp);
         //基站
//    // correct antenna delay
//    treply += ranging_ant_delays_get((uint8_t)(RX_MAIN_ANT_PORT));
@@ -100,14 +100,15 @@
         memcpy(&poll_tx_timestamp,&tag_polltx[i],4);
         memcpy(&resp_rx_timestamp,&tag_resprx[i],4);
         
         tround=ranging_timestamp_diff(resp_rx_timestamp, poll_tx_timestamp);
         tround=ranging_timestamp_diff1(resp_rx_timestamp, poll_tx_timestamp);
            tround_temp=tround;
            treply_temp=treply;
            //标签
         // correct antenna delay
//    tround -= ranging_ant_delays_get(uwb_app_config.ppdu_params.rx_ant_id);
         // corrected by frequency offset
         tround = (int64_t)((double)tround * (1 - (double)freq_offset_filter / ch_center_freq_map[UWB_CH_NUM]));
         tround = (int64_t)((double)tround * (1 - (double)freq_offset_filter /  uwb_ch_freq_table[UWB_CH_NUM]));
         tround_temp=tround;
         treply_temp=treply;
         tof_i = (int32_t)(tround - treply) / 2;