zhangbo
2025-07-11 7e660c15e78e77b12d98d97852cee50a2bd0479a
keil/uwb_app.c
@@ -49,11 +49,11 @@
//resp函数
void PushAnchorDataArray(uint16_t ancid,int16_t dist,uint8_t battary);//找到自己的id信息对应位置更新自己的交互信息
static void resp_msg_set_ts(uint8_t *ts_field, int64_t ts);//用来对应位置放入时间戳
static uint16_t tagid_list[TAG_NUM_IN_SYS];
uint16_t tagid_list[TAG_NUM_IN_SYS];
uint16_t CmpTagInList(uint16_t tagid);
uint8_t Anchor_RecNearPoll(uint8_t ancrec_nearbasepos);
static uint8_t send_buffer[100];
static uint8_t tagofflinetime[TAG_NUM_IN_SYS];
uint8_t tagofflinetime[TAG_NUM_IN_SYS];
uint32_t temp_count=0;
uint32_t temp_count1=0;
uint32_t temp_endcount1=0;
@@ -145,7 +145,7 @@
//    .phy_cfg.rx_ant_id = UWB_RX_ANT_3,    /* UWB RX antenna port                       */
//};
#ifdef UWB_MK8000_XB
static struct mk_uwb_configure config = {
 struct mk_uwb_configure config = {
    .phy_work_mode = (uint8_t)(PHY_TX | PHY_RX),
    .phy_cfg.ch_num = 5,                      /* Channel number.                           */
    .phy_cfg.code_index = 9,                  /* TRX preamble code                         */
@@ -162,7 +162,7 @@
};
#endif
#ifdef UWB_DW1000_MBXJZ_OLD
static struct mk_uwb_configure config = {
 struct mk_uwb_configure config = {
    .phy_work_mode = (uint8_t)(PHY_TX | PHY_RX),
    .phy_cfg.ch_num = 5,                      /* Channel number.                           */
    .phy_cfg.code_index = 9,                  /* TRX preamble code                         */
@@ -423,10 +423,10 @@
}
uint32_t start_receive_count,end_receive_count,poll_timeout,current_count,temp_resp;
uint16_t anchordata_id[TAG_NUM_IN_SYS],anchordata_dist[TAG_NUM_IN_SYS];
static uint8_t anchordata_bat[TAG_NUM_IN_SYS];
static int8_t anchor_rssi[TAG_NUM_IN_SYS];
uint8_t anchordata_bat[TAG_NUM_IN_SYS];
int8_t anchor_rssi[TAG_NUM_IN_SYS];
uint8_t anchordata_num = 0;
static int16_t tagdist_list[TAG_NUM_IN_SYS];
int16_t tagdist_list[TAG_NUM_IN_SYS];
uint16_t random_time;
//anchor
int32_t hist_dist;
@@ -820,7 +820,7 @@
//                Anchor_RecNearPoll(i);
//            }
        taglist_pos=CmpTagInList(tag_id_recv);
        if(taglist_num>=TAG_NUM_IN_SYS)
        if(taglist_pos>=TAG_NUM_IN_SYS)
            return 0;
        for(i=0; i<rec_nearbase_num; i++)
        {