From 6e5211bf6d6279e343cf0f8fca0341b78a29de9e Mon Sep 17 00:00:00 2001 From: chen <15335560115@163.com> Date: 星期四, 15 五月 2025 18:04:17 +0800 Subject: [PATCH] 初步能连接上,但是直接停止无任何测距版本 --- keil/include/main/main.c | 56 +++++++++++++++++++++++++++++++------------------------- 1 files changed, 31 insertions(+), 25 deletions(-) diff --git a/keil/include/main/main.c b/keil/include/main/main.c index 0f062ee..c9a34a8 100644 --- a/keil/include/main/main.c +++ b/keil/include/main/main.c @@ -246,33 +246,33 @@ uwb_open(); - // set advanced parameters - struct PHY_ADV_CONFIG_T adv_config = - { - // RPM0: 40, RPM3: 60 - .thres_fap_detect = 60, - // RPM0: 4, RPM3: 8 - .nth_scale_factor = 8, - // RFrame SP0: 0/1, Others: 0/1/2/3 - .ranging_performance_mode = 3, -#if RX_ANT_PORTS_NUM == 4 - .skip_weakest_port_en = 1, -#else - .skip_weakest_port_en = 0, -#endif - }; - phy_adv_params_configure(&adv_config); +// // set advanced parameters +// struct PHY_ADV_CONFIG_T adv_config = +// { +// // RPM0: 40, RPM3: 60 +// .thres_fap_detect = 60, +// // RPM0: 4, RPM3: 8 +// .nth_scale_factor = 8, +// // RFrame SP0: 0/1, Others: 0/1/2/3 +// .ranging_performance_mode = 3, +//#if RX_ANT_PORTS_NUM == 4 +// .skip_weakest_port_en = 1, +//#else +// .skip_weakest_port_en = 0, +//#endif +// }; +// phy_adv_params_configure(&adv_config); - // which RX ports will be used for AoA/PDoA - phy_rx_ant_mode_set(RX_ANT_PORTS_COMBINATION); +// // which RX ports will be used for AoA/PDoA +// phy_rx_ant_mode_set(RX_ANT_PORTS_COMBINATION); - uwbs_init(); - uwb_app_config.ranging_flow_mode = (uint8_t)(RANGING_FLOW_FIRA); - uwb_app_config.filter_en = (uint8_t)(FILTER_EN); - uwb_app_config.session_param.tx_power_level = board_param.tx_power_fcc[CALIB_CH(uwb_app_config.ppdu_params.ch_num)]; - uwb_app_config.ppdu_params.rx_ant_id = (uint8_t)(RX_MAIN_ANT_PORT); - - +// uwbs_init(); +// uwb_app_config.ranging_flow_mode = (uint8_t)(RANGING_FLOW_FIRA); +// uwb_app_config.filter_en = (uint8_t)(FILTER_EN); +// uwb_app_config.session_param.tx_power_level = board_param.tx_power_fcc[CALIB_CH(uwb_app_config.ppdu_params.ch_num)]; +// uwb_app_config.ppdu_params.rx_ant_id = (uint8_t)(RX_MAIN_ANT_PORT); + Uwb_init();//默认为我们测距配置 + OpenUWB(); // // Create UCI transmission layer task // @@ -295,6 +295,12 @@ while (1) { wsfOsDispatcher(); + if(normal_flag) + { + + uwb_app_poll();//我们的测距逻辑 + IdleTask(); + } power_manage(); } -- Gitblit v1.9.3