From 36667ff9eed83df5f6460d596220908afc9b9a11 Mon Sep 17 00:00:00 2001 From: yincheng.zhong <634916154@qq.com> Date: 星期二, 07 五月 2024 19:31:50 +0800 Subject: [PATCH] 改成中断触发模式,但是还是有BUG,会死机,还会有临近基站不测距的问题。 --- Src/application/dw_app.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/Src/application/dw_app.c b/Src/application/dw_app.c index 958f32a..586704c 100644 --- a/Src/application/dw_app.c +++ b/Src/application/dw_app.c @@ -156,4 +156,19 @@ break; } } +} +extern u8 uwb_rx_remaintime_ms,gps_chafenlingqi; +void UWB_RXStart(u8 tims_ms) +{ + if(!HAL_GPIO_ReadPin( RADIO_NSS_GPIO_Port, RADIO_NSS_Pin)) + { + gps_chafenlingqi++; + return; + } + UWB_Wkup(); + dwt_forcetrxoff(); + uwb_rx_remaintime_ms = tims_ms; + dwt_setinterrupt( DWT_INT_RFCG | (DWT_INT_ARFE | DWT_INT_RFSL | DWT_INT_SFDT | DWT_INT_RPHE | DWT_INT_RFCE | DWT_INT_RFTO | DWT_INT_RXPTO), 1); + dwt_setrxtimeout(tims_ms*1000);//设定接收超时时间,0位没有超时时间 + dwt_rxenable(0); } \ No newline at end of file -- Gitblit v1.9.3