| | |
| | | while(mac_is_busy()); |
| | | gpio_pin_clr(SCL_PIN); |
| | | } |
| | | uint16_t uwb_searchcount,range_timeout_us = 1700; |
| | | uint16_t uwb_searchcount,range_timeout_us = 2000; |
| | | uint8_t flag_recsuccess; |
| | | |
| | | extern uint8_t g_start_send_flag,search_open_flag = 1,link_success_flag; |
| | |
| | | uint32_t UWB_shoudao_count=0; |
| | | uint32_t UWB_fachu_count=0; |
| | | uint32_t UWB_qiangzhanfachu_count=0; |
| | | |
| | | uint32_t UWB_1003_count,UWB_6666_count=0; |
| | | int UwbRange(void) |
| | | { |
| | | uint8_t i; |
| | |
| | | // temp_count3=phy_timer_count_get(); |
| | | //gpio_pin_set(SCL_PIN); |
| | | time_count_dkjs=phy_timer_count_get(); |
| | | gpio_pin_set(IO_PIN_5);//测试 |
| | | // gpio_pin_set(IO_PIN_5);//测试 |
| | | // gpio_pin_clr(IO_PIN_5); |
| | | uwb_rxflag=uwb_rx(0, 0, range_timeout_us);//开启接收 |
| | | // gpio_pin_clr(IO_PIN_5);//测试 |
| | |
| | | time_count_sdsj=phy_timer_count_get(); |
| | | UWB_shoudao_count++; |
| | | // gpio_pin_set(IO_PIN_5);//测试 |
| | | gpio_pin_clr(IO_PIN_5); |
| | | // gpio_pin_clr(IO_PIN_5); |
| | | #ifdef DEBUG_BOXING |
| | | // gpio_pin_set(IO_PIN_5);//测试 |
| | | // gpio_pin_clr(IO_PIN_5);//测试 |
| | |
| | | //rec_nearbase_num=25; |
| | | |
| | | memcpy(&tag_id_recv,&rx_buf[TAG_ID_IDX],2); |
| | | |
| | | memcpy(rec_ancidlist,&rx_buf[FZ_NEARBASEID_INDEX],2*rec_nearbase_num); |
| | | memcpy(rec_ancdistlist,&rx_buf[FZ_NEARBASEID_INDEX+2*rec_nearbase_num],2*rec_nearbase_num); |
| | | memcpy(&rec_antdelay,&rx_buf[FZ_NEARBASEID_INDEX+rec_nearbase_num*4],2); |
| | |
| | | { |
| | | rec_ancdistlist[i]+=(int16_t)g_com_map[DIST_OFFSET]; |
| | | PushAnchorDataArray(tag_id_recv,rec_ancdistlist[i],battary); |
| | | if(tag_id_recv==0x1003) |
| | | { |
| | | UWB_1003_count++; |
| | | } |
| | | else if(tag_id_recv==0x6666) |
| | | { |
| | | UWB_6666_count++; |
| | | } |
| | | UWB_fachu_count++; |
| | | // #ifdef DEBUG_BOXING |
| | | //// gpio_pin_clr(IO_PIN_5);//测试 |
| | |
| | | // uwb_rxflag=uwb_rx(0, 0, range_timeout_us); |
| | | } |
| | | #ifdef DEBUG_BOXING |
| | | gpio_pin_clr(IO_PIN_5);//测试 |
| | | // gpio_pin_clr(IO_PIN_5);//测试 |
| | | // gpio_pin_set(IO_PIN_5);//测试 |
| | | #endif |
| | | |