yincheng.zhong
2024-11-12 c8cbb8205d69b4120122a7d0923edcca611399ef
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);