yincheng.zhong
2024-03-06 49809f7d7fa724ee6594c086192a4c88ebce7a53
Src/application/dw_app.c
@@ -70,8 +70,15 @@
#define FINAL_MSG_RESP_RX_TS_IDX 14
#define FINAL_MSG_FINAL_TX_TS_IDX 18
#define FINAL_MSG_TS_LEN 4
//#define _UWB_4G
static dwt_config_t config = {
   5,               /* Channel number. */
#ifdef _UWB_4G
   2,               /* Channel number. */
#else
    5,
#endif
   DWT_PRF_64M,     /* Pulse repetition frequency. */
   DWT_PLEN_64,    /* Preamble length. */
   DWT_PAC8,        /* Preamble acquisition chunk size. Used in RX only. */
@@ -338,7 +345,11 @@
      {
         // exsistbase_list[i]--;
          clockOffsetRatio = anc_clockoffset[i] * (FREQ_OFFSET_MULTIPLIER * HERTZ_TO_PPM_MULTIPLIER_CHAN_5 / 1.0e6) ;
#ifdef _UWB_4G
            clockOffsetRatio = anc_clockoffset[i] * (FREQ_OFFSET_MULTIPLIER * HERTZ_TO_PPM_MULTIPLIER_CHAN_2 / 1.0e6) ;
#else
            clockOffsetRatio = anc_clockoffset[i] * (FREQ_OFFSET_MULTIPLIER * HERTZ_TO_PPM_MULTIPLIER_CHAN_5 / 1.0e6) ;
#endif
          rtd_init = tag_resprx[i] - poll_tx_ts;
          rtd_resp = anc_resptx[i] - anc_pollrx[i];
          tof = ((rtd_init - rtd_resp * (1 - clockOffsetRatio)) / 2.0) * DWT_TIME_UNITS;
@@ -346,7 +357,7 @@
          if(distance>-10&&distance<1000)
            nearbase_distlist[i] = distance*100+anc_distoffset[i];
      }else{
         // nearbase_distlist[i] = 0x1ffff;
          nearbase_distlist[i] = 0x1ffff;
      }
    
    }