From 12ef59c562f0bfa5b7f9f4ac808a7d340adab9de Mon Sep 17 00:00:00 2001
From: yincheng.zhong <634916154@qq.com>
Date: 星期一, 11 三月 2024 14:20:43 +0800
Subject: [PATCH] 微功率版本

---
 Src/application/dw_app.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/Src/application/dw_app.c b/Src/application/dw_app.c
index 0ac5c30..c8086cd 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;
@@ -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;
       }
     
     }

--
Gitblit v1.9.3