| | |
| | | extern uint16_t tag_frequency; |
| | | extern uint16_t disoffset; |
| | | static uint8_t frame_len,recpoll_len,current_syncid,new_tagid,seize_anchor,result,g_start_sync_flag; |
| | | extern uint8_t gps_power_state,motor_power_state,uwb_state,air780_power_state,gps_success_state,chaging_state,changed_state,air780_success_state; |
| | | extern uint8_t gps_power_state,motor_power_state,uwb_state,air780_power_state,gps_success_state,red_charge_state,green_charge_state,air780_success_state; |
| | | int poll_rx_num,resp_tx_num; |
| | | //resp函数 |
| | | void PushAnchorDataArray(uint16_t ancid,int16_t dist,uint8_t battary);//找到自己的id信息对应位置更新自己的交互信息 |
| | |
| | | uwb_tx(send_buffer, 40,1 ,resp_tx_en_start_u32);//立即发送测试size大小 |
| | | temp_count1=phy_timer_count_get(); |
| | | while(mac_is_busy()); |
| | | #ifdef BO_XING |
| | | gpio_pin_clr(SCL_PIN); |
| | | #endif |
| | | } |
| | | uint32_t range_timeout_us = 5000; |
| | | uint16_t uwb_searchcount; |
| | |
| | | receive_flag = 0; |
| | | flag_recsuccess = 0; |
| | | temp_count3=phy_timer_count_get(); |
| | | #ifdef BO_XING |
| | | gpio_pin_set(SCL_PIN); |
| | | #endif |
| | | flag_temp1=uwb_rx(0, 0, range_timeout_us);//开启接收 |
| | | |
| | | // while(mac_is_busy()); |
| | |
| | | recev_error_num=0; |
| | | range_timeout_us=5000;//恢复为5000进入range后 |
| | | LOG_INFO(TRACE_MODULE_APP,"标签ID:%X,距离: %d 信号强度:%d.\r\n",g_com_map[BIND_DEV_ID],distance,rssi); |
| | | #ifdef BO_XING |
| | | gpio_pin_clr(SCL_PIN); |
| | | #endif |
| | | break; |
| | | } |
| | | } |
| | |
| | | mac_register_process_handler(tx_int_callback, rx_int_callback); |
| | | receive_flag = 0; |
| | | temp_count3=phy_timer_count_get(); |
| | | #ifdef BO_XING |
| | | gpio_pin_set(SCL_PIN); |
| | | #endif |
| | | flag_temp2=uwb_rx(0, 0, RX_SYNC_WIN_US_TEMP);//开启接收 |
| | | start_receive_count=phy_timer_count_get(); |
| | | poll_timeout=US_TO_PHY_TIMER_COUNT(2000000);//多一个多0.4ms默认0.4ms计算为0.125*4*100000,默认开启1mss |
| | |
| | | seize_anchor=1; //抢占anchor |
| | | Anchor_RecNearPoll(i); |
| | | } |
| | | |
| | | #ifdef BO_XING |
| | | gpio_pin_clr(SCL_PIN);//测试 |
| | | #endif |
| | | LOG_INFO(TRACE_MODULE_APP,"标签ID:%X,距离: %d 信号强度:%d.\r\n",g_com_map[BIND_DEV_ID],distance,rssi); |
| | | return 1;//返回发送成功标志 |
| | | } |
| | |
| | | delay_us(2); |
| | | uwb_rx_force_off(1); |
| | | // LOG_INFO(TRACE_MODULE_APP,"超时定时器:%x,%x,%x\r\n",start_receive_count,end_receive_count,current_count); |
| | | #ifdef BO_XING |
| | | gpio_pin_clr(SCL_PIN);//测试 |
| | | #endif |
| | | return 0;//返回绑定失败标志 |
| | | } |
| | | //} |