| | |
| | | uint16_t warning_distance,prewarning_distance; |
| | | int16_t fVoltage_mv,first_search_flag; |
| | | uint8_t bat_percent,g_start_send_flag=1; |
| | | uint8_t LORA_REV_uwb_up =0; |
| | | uint8_t link_success_flag,motor_count; |
| | | uint16_t gps_wait_count; |
| | | uint8_t state5v = 1; |
| | |
| | | { |
| | | rf_set_recv_flag(RADIO_FLAG_IDLE); |
| | | memcpy(RF_RX_temp,RxDoneParams.Payload,RxDoneParams.Size); |
| | | if(RF_RX_temp[0]==0) |
| | | if(RF_RX_temp[0]==0x48&&RF_RX_temp[1]==0x58) |
| | | { |
| | | |
| | | LORA_REV_uwb_up=1; |
| | | |
| | | } |
| | | // rf_enter_continous_rx(); //重新进入接收模式 |
| | | //UwbRange(); |
| | |
| | | // adc_get(&sample[0], NUM_SAMPLES, adc_callback);//adc采样 |
| | | Program_Init(); |
| | | // uart_receive(UART_ID1,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart_receive_callback); |
| | | // |
| | | // |
| | | //// Initialize low power mode |
| | | // power_init(); |
| | | // AIR780E_Reset(); //4G模块重启,耗时1.5秒,这个是无法同步的关键 |
| | | sleep_timer_open(true, SLEEP_TIMER_MODE_RELOAD, sleep_timer_callback); |
| | | |
| | | sleep_timer_start(__MS_TO_32K_CNT(1000));//测试 |
| | | |
| | | #ifdef DEBUG_BOXING |
| | | io_pin_mux_set(IO_PIN_5,IO_FUNC0); |
| | | gpio_pin_set_dir(IO_PIN_5,GPIO_DIR_OUT,0); |
| | | io_pull_set(IO_PIN_5,IO_PULL_DOWN,IO_PULL_UP_LEVEL4); |
| | | #endif |
| | | // board_acceleration_detection_init(move_handler); |
| | | Uwbinit(); |
| | | while (1) |
| | | { |
| | | if(LORA_REV_uwb_up) |
| | | { |
| | | LORA_REV_uwb_up=0; |
| | | UwbRange(); |
| | | } |
| | | if(g_start_send_flag) |
| | | { |
| | | g_start_send_flag=0; |
| | | |
| | | } |
| | | |
| | | |
| | | UwbRange(); |
| | | // UwbRange(); |
| | | // rf_irq_process(); |
| | | // if(rf_get_transmit_flag() == RADIO_FLAG_TXDONE) |
| | | // { |