| | |
| | | uwb_tx(send_buffer, 40,1 ,resp_tx_en_start_u32);//立即发送测试size大小 |
| | | temp_count1=phy_timer_count_get(); |
| | | while(mac_is_busy()); |
| | | gpio_pin_clr(SCL_PIN); |
| | | // gpio_pin_clr(SCL_PIN); |
| | | } |
| | | uint16_t uwb_searchcount,uwb_timer_reload_value = 496; |
| | | uint8_t range_success; |
| | |
| | | range_success = 0; |
| | | receive_flag = 0; |
| | | temp_count3=phy_timer_count_get(); |
| | | gpio_pin_set(SCL_PIN); |
| | | // gpio_pin_set(SCL_PIN); |
| | | uwb_rx(0, 0, RX_SYNC_WIN_US);//开启接收 |
| | | temp_count2=phy_timer_count_get(); |
| | | start_receive_count=phy_timer_count_get(); |
| | |
| | | range_success = 1; |
| | | sleep_timer_start(__MS_TO_32K_CNT(uwb_timer_reload_value));//测试 |
| | | |
| | | gpio_pin_clr(SCL_PIN); |
| | | // gpio_pin_clr(SCL_PIN); |
| | | delay_time = (current_count-start_receive_count)>>7; |
| | | |
| | | LOG_INFO(TRACE_MODULE_APP,"标签ID:%X,距离: %d 信号强度:%d. 等待时间%d\r\n",g_com_map[BIND_DEV_ID],distance,rssi,delay_time); |
| | |
| | | mac_register_process_handler(tx_int_callback, rx_int_callback); |
| | | receive_flag = 0; |
| | | temp_count3=phy_timer_count_get(); |
| | | gpio_pin_set(SCL_PIN); |
| | | // gpio_pin_set(SCL_PIN); |
| | | 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 |
| | |
| | | Anchor_RecNearPoll(i); |
| | | } |
| | | sleep_timer_start(__MS_TO_32K_CNT(UWB_DELAY_TIME_US));//测试 |
| | | gpio_pin_clr(SCL_PIN);//测试 |
| | | // gpio_pin_clr(SCL_PIN);//测试 |
| | | return 1;//返回发送成功标志 |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | // LOG_INFO(TRACE_MODULE_APP,"超时定时器:%x,%x,%x\r\n",start_receive_count,end_receive_count,current_count); |
| | | gpio_pin_clr(SCL_PIN);//测试 |
| | | // gpio_pin_clr(SCL_PIN);//测试 |
| | | return 0;//返回绑定失败标志 |
| | | } |
| | | //} |