| | |
| | | SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader |
| | | } |
| | | Radio.Standby(); |
| | | Radio.Rx( 80 ); |
| | | Radio.Rx( 100 ); |
| | | // LED_TB_OFF; |
| | | } |
| | | extern LPTIM_HandleTypeDef hlptim1; |
| | |
| | | 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; |
| | |
| | | } |
| | | HAL_GPIO_WritePin(GPIOC, GPIO_PIN_7, GPIO_PIN_SET); |
| | | HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_SET); |
| | | memcpy(&xiafayuyin_data,&RX_Buffer[9],RX_Buffer[8]); |
| | | 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; |
| | |
| | | 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); |
| | | } |