From 07f7a9b6e66e5673380e173c4d710d6f9acb557d Mon Sep 17 00:00:00 2001 From: chen <15335560115@163.com> Date: 星期三, 28 五月 2025 14:36:07 +0800 Subject: [PATCH] 增加5V输入检测,每检测到5V输入30s内不休眠,开始时1s不休眠版本 --- keil/dw_app.c | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/keil/dw_app.c b/keil/dw_app.c index 0f00856..45c2966 100644 --- a/keil/dw_app.c +++ b/keil/dw_app.c @@ -5,6 +5,7 @@ #include "mk_misc.h" #include "mk_uart.h" #include "mk_trace.h" +#include "global_param.h" static float clockOffsetRatio; static double rtd_init, rtd_resp; double tof,distance; @@ -35,7 +36,7 @@ memcpy(&tag_resprx[i],&resprx,4); memcpy(&anc_distoffset[i],distoffset,2); memcpy(&tag_polltx[i],&polltx,4); - //anc_clockoffset[i] = anc_clockoffset_from_MK;//MK8000修改 + anc_clockoffset[i] = freq_offset;//MK8000修改 } void CalculateDists1(int64_t poll_tx_ts) { @@ -79,10 +80,9 @@ } void CalculateDists(int64_t poll_tx_ts) { - for(int i=0;i<MAX_NEARBASE_NUM;i++) + for(int i=0;i<MAX_NEARBASE_NUM+10;i++) { - - if(exsistbase_list[i]==KEEP_TIMES) + if(taglist_keeptime[i+taglist_current_index]==KEEP_TIMES) { //temp_freq_offset=freq_offset_filter;//测试 @@ -108,7 +108,7 @@ // correct antenna delay // tround -= ranging_ant_delays_get(uwb_app_config.ppdu_params.rx_ant_id); // corrected by frequency offset - tround = (int64_t)((double)tround * (1 - (double)freq_offset_filter / ch_center_freq_map[UWB_CH_NUM])); + tround = (int64_t)((double)tround * (1 - (double)anc_clockoffset[i] / ch_center_freq_map[UWB_CH_NUM])); tround_temp=tround; treply_temp=treply; tof_i = (int32_t)(tround - treply) / 2; @@ -128,10 +128,12 @@ if(distance>-1000&&distance<100000) { - nearbase_distlist[i] = distance+anc_distoffset[i];//offset未加 - } + taglist_dist[i+taglist_current_index] = distance+(int16_t)g_com_map[DIST_OFFSET];//offset未加 + }else{ + taglist_dist[i] = 0x2ffff; + } }else{ - nearbase_distlist[i] = 0x1ffff; + //nearbase_distlist[i] = 0x7fff; } } -- Gitblit v1.9.3