1
WXK
2024-03-15 bfa1481d9e7b053fe7d67dbb451aa41d4b4f3fab
Src/radio/Lora.c
@@ -198,7 +198,8 @@
    {
            UWB_Wkup();
//        memcpy(&test111,&RX_Buffer[1],2);
            MbxTagUwbRec();
            MbxTagUwbRec();
test111++;
//        HAL_GPIO_WritePin(GPIOC, GPIO_PIN_5, GPIO_PIN_RESET);
//        printf("LORA IdleTask:%x",test111);        
            HAL_GPIO_WritePin(RADIO_NSS_GPIO_Port, RADIO_NSS_Pin, GPIO_PIN_RESET); //片选lora有效
@@ -225,7 +226,7 @@
                        target_count = current_count + rec_delaytime*3.2768 - delaytime;
                        while(target_count>=32768)
                            target_count-=32768;
                        __HAL_LPTIM_COMPARE_SET(&hlptim1, target_count);
//                        __HAL_LPTIM_COMPARE_SET(&hlptim1, target_count);
                        rx_count = HAL_LPTIM_ReadCounter(&hlptim1);
                     //   printf("tx %d,rx %d,delay %d",current_count>>5,rx_count>>5,rec_delaytime);
                        break;
@@ -247,7 +248,11 @@
                            memcpy(&xiafayuyin_data,&RX_Buffer[PWTAG_WRITE_VALUE_IDX],BufferSize-PWTAG_WRITE_VALUE_IDX);
                            yuyin_sendflag=1;           
                            yuyinzidongguan_time=0;             
                            yuyin_no_sleep_flag=1;
                            yuyin_no_sleep_flag=1;
//                            SYN_FrameInfo(0,xiafayuyin_data); //播放内容
//                            memset(xiafayuyin_data,0,sizeof(xiafayuyin_data));
                            LoraRspWriteCommap(SUBMSG_WRITE_ANCPARA);
                            no_rx_flag = 1;
                        }else{
                            memcpy(&rec_value,&RX_Buffer[PWTAG_WRITE_VALUE_IDX],2);
                            g_com_map[rec_index/2] = rec_value;
@@ -282,7 +287,7 @@
    target_count-=current_count%3276;
    while(target_count<0)
        target_count+=32768;
    __HAL_LPTIM_COMPARE_SET(&hlptim1, target_count);
//    __HAL_LPTIM_COMPARE_SET(&hlptim1, target_count);
    SwitchLoraSettings(UWB_CHANNEL_FRQ+g_com_map[GROUP_ID],UWB_CHANNEL_SF,0);
    Radio.Rx(0);
}