|
你好,想问一下我的6基站,根据原来的代码增加到6基站发送通信,然后通过增加延迟所有基站都可以成功发送和接受,但是屏幕没有输出距离,貌似卡在了 /* Increment frame sequence number after transmission of the poll message (modulo 256). */
if (status_reg & SYS_STATUS_RXFCG)
{
/* Clear good/fail RX frame event in the DW1000 status register. */
dwt_write32bitreg(SYS_STATUS_ID, SYS_STATUS_RXFCG | SYS_STATUS_TXFRS);
/* A frame has been received, read it into the local buffer. */
frame_len = dwt_read32bitreg(RX_FINFO_ID) & RX_FINFO_RXFLEN_MASK;
if (frame_len <= RX_BUF_LEN)
{
dwt_readrxdata(rx_buffer, frame_len, 0);
}
if(rx_buffer[ALL_MSG_TAG_IDX] != TAG_ID)
continue;
rx_buffer[ALL_MSG_TAG_IDX] = 0;
/*As the sequence number field of the frame is not relevant, it is cleared to simplify the validation of the frame. */
rx_buffer[ALL_MSG_SN_IDX] = 0;
OLED_ShowString(0,2,"ok");
if (memcmp(rx_buffer, distance_msg, ALL_MSG_COMMON_LEN) == 0)
{
// final_distance = rx_buffer[10] + (float)rx_buffer[11]/100;
Anthordistance[rx_buffer[12]] +=(rx_buffer[10]*1000 + rx_buffer[11]*10);
Anthordistance_count[rx_buffer[12]] ++;
OLED_ShowString(0,4,"buff");
{
int Anchor_Index = 0;
while(Anchor_Index < ANCHOR_MAX_NUM)
{
OLED_ShowString(0,0," 444");
if(Anthordistance_count[Anchor_Index] >=ANCHOR_REFRESH_COUNT )
{
distance_mange();
OLED_ShowString(0,6," 51UWB Node");
Anchor_Index = 0;
//clear all
while(Anchor_Index < ANCHOR_MAX_NUM)
{
Anthordistance_count[Anchor_Index] = 0;
Anthordistance[Anchor_Index] = 0;
Anchor_Index++;
}
break;
}
Anchor_Index++;
}
}
}
}这里,延迟是这样#define UUS_TO_DWT_TIME 65536
/* Delay between frames, in UWB microseconds. See NOTE 4 below. */
/* This is the delay from Frame RX timestamp to TX reply timestamp used for calculating/setting the DW1000's delayed TX function. This includes the
* frame length of approximately 2.46 ms with above configuration. */
#define POLL_RX_TO_RESP_TX_DLY_UUS 3000 //
/* This is the delay from the end of the frame transmission to the enable of the receiver, as programmed for the DW1000's wait for response feature. */
#define RESP_TX_TO_FINAL_RX_DLY_UUS 500 //500
/* Receive final timeout. See NOTE 5 below. */
#define FINAL_RX_TIMEOUT_UUS 3300 //3300
/* Delay between frames, in UWB microseconds. See NOTE 4 below. */
/* This is the delay from the end of the frame transmission to the enable of the receiver, as programmed for the DW1000's wait for response feature. */
#define POLL_TX_TO_RESP_RX_DLY_UUS 150//150
/* This is the delay from Frame RX timestamp to TX reply timestamp used for calculating/setting the DW1000's delayed TX function. This includes the
* frame length of approximately 2.66 ms with above configuration. */
#define RESP_RX_TO_FINAL_TX_DLY_UUS 3500 //2700 will fail
/* Receive response timeout. See NOTE 5 below. */
#define RESP_RX_TIMEOUT_UUS 2700 //2700
想问一下怎么改呢 |
|