WXK
2023-12-27 87f40001bac1e3595283dabe5ea3baaf38f255a5
Src/application/dw_ancapp.c
@@ -180,6 +180,7 @@
u16 basesystimer,uwb_losttimer;
uint8_t remotesend_state,remotesend_index;
uint16_t random_time;
u32 value;
uint8_t Anchor_RecNearPoll(uint8_t ancrec_nearbasepos) //0 mainbase  1 first near_base
{
    uint8_t motorstate;
@@ -195,10 +196,10 @@
    if(rec_nearbase_num == ancrec_nearbasepos)//抢占模式
    {
        random_time = (GetLPTime()%100);
           resp_tx_time = (poll_rx_ts+((random_time+rec_nearbase_num*20 + POLL_RX_TO_RESP_TX_DLY_UUS+ancrec_nearbasepos*DELAY_BETWEEN_TWO_FRAME_UUS) * UUS_TO_DWT_TIME)) >> 8;//计算Response发送时间T3。
           resp_tx_time = (poll_rx_ts+((/*value+*/random_time+rec_nearbase_num*20 + POLL_RX_TO_RESP_TX_DLY_UUS+ancrec_nearbasepos*DELAY_BETWEEN_TWO_FRAME_UUS) * UUS_TO_DWT_TIME)) >> 8;//计算Response发送时间T3。
  
    }else{
           resp_tx_time = (poll_rx_ts + ((rec_nearbase_num*20+POLL_RX_TO_RESP_TX_DLY_UUS+ancrec_nearbasepos*DELAY_BETWEEN_TWO_FRAME_UUS) * UUS_TO_DWT_TIME)) >> 8;//计算Response发送时间T3。
           resp_tx_time = (poll_rx_ts + ((/*value+ */rec_nearbase_num*20+POLL_RX_TO_RESP_TX_DLY_UUS+ancrec_nearbasepos*DELAY_BETWEEN_TWO_FRAME_UUS) * UUS_TO_DWT_TIME)) >> 8;//计算Response发送时间T3。
    }
            dwt_setdelayedtrxtime(resp_tx_time);//设置Response发送时间T3
         //dwt_setrxaftertxdelay(RESP_TX_TO_FINAL_RX_DLY_UUS+(rec_nearbase_num+1-ancrec_nearbasepos)*DELAY_BETWEEN_TWO_FRAME_UUS);//设置发送完成后开启接收延迟时间
@@ -414,6 +415,7 @@
                  break;
               }                  
            }
               if(i==rec_nearbase_num)
               {
                  seize_anchor=1;   //抢占anchor