| | |
| | | uint8_t phy_work_mode; /* PHY_TX / PHY_RX / PHT_TX|PHY_RX */ |
| | | struct UWB_CONFIG_T phy_cfg; |
| | | }; |
| | | |
| | | extern uint8_t uwb_ch; |
| | | static struct mk_uwb_configure config = { |
| | | .phy_work_mode = (uint8_t)(PHY_TX | PHY_RX), |
| | | .phy_cfg.ch_num = 5, /* Channel number. */ |
| | |
| | | rssi = rx_report->rssi; |
| | | receive_flag=1; |
| | | // uart_send(UART_ID0, rx_buf,rx_length, NULL); |
| | | gpio_pin_toggle(IO_PIN_4); |
| | | if(rx_buf[MESSAGE_TYPE_IDX]==MBX_POLL) |
| | | { |
| | | Anchor_App(); |
| | |
| | | // } |
| | | } |
| | | } |
| | | |
| | | |
| | | #ifdef STS_MODE |
| | | valid_sts= sts_valid_check(); |
| | | if (valid_sts) |
| | |
| | | //while(mac_is_busy()); |
| | | gpio_pin_clr(SCL_PIN); |
| | | cmd_flag=1; |
| | | if(send_buffer[RW_FLAG_IDX]==0x01) |
| | | { |
| | | delay_ms(100); |
| | | NVIC_SystemReset(); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | |
| | | memcpy(&uwbsend[4+taglist_num*2],&tagdist_list,taglist_num*2); |
| | | memcpy(&uwbsend[4+taglist_num*4],&anchordata_version,taglist_num*2); |
| | | uart_send(UART_ID0, uwbsend,taglist_num*6+4, NULL); |
| | | taglist_num=0; |
| | | // for(int i=0;i<anchordata_num;i++) |
| | | // { |
| | | // LOG_INFO(TRACE_MODULE_APP,"当前测距基站ID:%x,距离:%d.\r\n",tagid_list[0],tagdist_list[0]); |
| | |
| | | phy_rx_ant_mode_set(RX_ANT_PORTS_COMBINATION); |
| | | #endif |
| | | // Set calibration parameters |
| | | config.phy_cfg.ch_num=g_com_map[NEARBASE_ID1]; |
| | | uwb_calibration_params_set(config.phy_cfg.ch_num); |
| | | #ifndef STS_MODE |
| | | // set advanced parameters |