From ad06045e4c5dfa4111b3e10f0fd86e0a343b7c7b Mon Sep 17 00:00:00 2001 From: WXK <287788329@qq.com> Date: 星期二, 01 四月 2025 15:11:50 +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