From a6030824567b93e5416744033a1900a89215533f Mon Sep 17 00:00:00 2001
From: WXK <287788329@qq.com>
Date: 星期一, 11 九月 2023 10:31:35 +0800
Subject: [PATCH] 1

---
 Src/application/dw_app.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/Src/application/dw_app.c b/Src/application/dw_app.c
index 0ac5c30..ffaba58 100644
--- a/Src/application/dw_app.c
+++ b/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;

--
Gitblit v1.9.3