From 9115414a73e9c9e47a6659be95c6f9f0304757f8 Mon Sep 17 00:00:00 2001 From: yincheng.zhong <634916154@qq.com> Date: 星期二, 19 十一月 2024 11:18:39 +0800 Subject: [PATCH] V2.6 改成SF8,搭配基站1.30 实现3秒定位一次 --- Src/radio/Lora.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Src/radio/Lora.c b/Src/radio/Lora.c index c4fe696..11f4263 100644 --- a/Src/radio/Lora.c +++ b/Src/radio/Lora.c @@ -261,7 +261,8 @@ { UWB_Wkup(); MbxTagUwbRec(); - HAL_GPIO_WritePin(RADIO_NSS_GPIO_Port, RADIO_NSS_Pin, GPIO_PIN_RESET); //片选lora有效 + HAL_GPIO_WritePin(RADIO_NSS_GPIO_Port, RADIO_NSS_Pin, GPIO_PIN_RESET); //片选lora有效 + Radio.Rx(0); } if(RX_Buffer[MSG_TYPE_IDX]==LORA_MSGTYPE_WGRESPTAG) { @@ -350,7 +351,6 @@ } } } - } if(!no_rx_flag) { if(lora_jianting_flag&&LoraUp_flag==0) @@ -359,6 +359,8 @@ Radio.Rx(0); } } + } + } void OnTxTimeout( void ) @@ -372,10 +374,11 @@ void OnRxTimeout( void ) { Radio.Standby(); - if(wg_state==WG_Lost) + { - current_count = HAL_LPTIM_ReadCounter(&hlptim1); - target_count-=current_count%3276; +// current_count = HAL_LPTIM_ReadCounter(&hlptim1); +// target_count-=current_count%3276; + target_count-=66;//提前2ms发lora while(target_count<0) target_count+=32768; __HAL_LPTIM_COMPARE_SET(&hlptim1, target_count); -- Gitblit v1.9.3