From de981d775c77551692b618ba9bfe60d5cd7f1532 Mon Sep 17 00:00:00 2001
From: WXK <287788329@qq.com>
Date: 星期二, 12 八月 2025 17:46:07 +0800
Subject: [PATCH] 开发完成
---
keil/dw_app_anchor.c | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/keil/dw_app_anchor.c b/keil/dw_app_anchor.c
index 9ca7df8..ff1fa33 100644
--- a/keil/dw_app_anchor.c
+++ b/keil/dw_app_anchor.c
@@ -24,31 +24,31 @@
memcpy(&anc_distoffset[i],distoffset,2);
anc_clockoffset[i] = anc_clockoffset_from_MK;//MK8000修改
}
-void CalculateDists(int64_t poll_tx_ts)
+void CalculateDists(int64_t poll_tx_ts)
{
-for(int i=0;i<MAX_NEARBASE_NUM;i++)
+ for(int i=0; i<MAX_NEARBASE_NUM; i++)
{
//rec_anc_signalpower[i] = exsistbase_list[i];
- if(exsistbase_list[i]==KEEP_TIMES)
- {
- // exsistbase_list[i]--;
+ if(exsistbase_list[i]==KEEP_TIMES)
+ {
+ // exsistbase_list[i]--;
#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) ;//MK8000修改
#endif
- rtd_init = tag_resprx[i] - (uint32_t)poll_tx_ts;
- rtd_resp = anc_resptx[i] - anc_pollrx[i];
- tof = ((rtd_init - rtd_resp * (1 - clockOffsetRatio)) / 2.0) * DWT_TIME_UNITS;
- distance = tof * SPEED_OF_LIGHT;
- if(distance>-10&&distance<1000)
- {
- nearbase_distlist[i] = distance*100+anc_distoffset[i];
- }
- }else{
- // nearbase_distlist[i] = 0x1ffff;
- }
-
+ rtd_init = tag_resprx[i] - (uint32_t)poll_tx_ts;
+ rtd_resp = anc_resptx[i] - anc_pollrx[i];
+ tof = ((rtd_init - rtd_resp * (1 - clockOffsetRatio)) / 2.0) * DWT_TIME_UNITS;
+ distance = tof * SPEED_OF_LIGHT;
+ if(distance>-10&&distance<1000)
+ {
+ nearbase_distlist[i] = distance*100+anc_distoffset[i];
+ }
+ } else {
+ // nearbase_distlist[i] = 0x1ffff;
+ }
+
}
}
--
Gitblit v1.9.3