From e3dedf3cc3d29191937ba908d1cee233eb0adb2d Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期日, 06 九月 2020 14:31:51 +0800 Subject: [PATCH] 远距离110K代码测试完成 --- 源码/核心板/Src/application/dw_app.c | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-) diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" index 52bcef1..9dc7c00 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" @@ -46,16 +46,15 @@ #define POLL_TX_TO_RESP_RX_DLY_UUS 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 400 +#define RESP_RX_TO_FINAL_TX_DLY_UUS 4100 /* Receive response timeout. See NOTE 5 below. */ -#define RESP_RX_TIMEOUT_UUS 600 +#define RESP_RX_TIMEOUT_UUS 4700 -#define POLL_RX_TO_RESP_TX_DLY_UUS 420 +#define POLL_RX_TO_RESP_TX_DLY_UUS 3600 /* 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 200 +#define RESP_TX_TO_FINAL_RX_DLY_UUS 500 /* Receive final timeout. See NOTE 5 below. */ #define FINAL_RX_TIMEOUT_UUS 4300 - #define SPEED_OF_LIGHT 299702547 /* Indexes to access some of the fields in the frames defined above. */ @@ -90,16 +89,16 @@ /*------------------------------------ Variables ------------------------------------------*/ /* Default communication configuration. We use here EVK1000's default mode (mode 3). */ static dwt_config_t config = { - 2, /* Channel number. */ - DWT_PRF_64M, /* Pulse repetition frequency. */ - DWT_PLEN_128, /* Preamble length. */ - DWT_PAC8, /* Preamble acquisition chunk size. Used in RX only. */ - 9, /* TX preamble code. Used in TX only. */ - 9, /* RX preamble code. Used in RX only. */ - 1, /* Use non-standard SFD (Boolean) */ - DWT_BR_6M8, /* Data rate. */ - DWT_PHRMODE_STD, /* PHY header mode. */ - (129 + 8 - 8) /* SFD timeout (preamble length + 1 + SFD length - PAC size). Used in RX only. */ + 2, /* Channel number. */ + DWT_PRF_64M, /* Pulse repetition frequency. */ + DWT_PLEN_1024, /* Preamble length. */ + DWT_PAC32, /* Preamble acquisition chunk size. Used in RX only. */ + 9, /* TX preamble code. Used in TX only. */ + 9, /* RX preamble code. Used in RX only. */ + 1, /* Use non-standard SFD (Boolean) */ + DWT_BR_110K, /* Data rate. */ + DWT_PHRMODE_STD, /* PHY header mode. */ + (1025 + 64 - 32) /* SFD timeout (preamble length + 1 + SFD length - PAC size). Used in RX only. */ }; /* Frames used in the ranging process. See NOTE 2 below. */ @@ -329,6 +328,7 @@ extern uint16_t sync_timer; u16 tmp_time; extern float dw_vbat; +extern u16 slottime,max_slotnum,current_slotpos,tyncpoll_time; void Tag_App(void)//发送模式(TAG标签) { uint32_t frame_len; @@ -493,10 +493,10 @@ // deca_sleep(10); } // dwt_entersleep(); -// if(tag_succ_times<g_com_map[MIN_REPORT_ANC_NUM]) -// { -// //poll_timer +=time32_incr&0x7+3; -// } + if(tag_succ_times<1) + { + tyncpoll_time=(current_slotpos--%max_slotnum)*slottime; + } /* Execute a delay between ranging exchanges. */ @@ -648,7 +648,7 @@ hex_dist = dist_cm+(int16_t)g_com_map[DIST_OFFSET]*10; if(tag_id_recv-TAG_ID_START<=TAG_NUM_IN_SYS) { - if(hex_dist-his_dist[tag_id_recv-TAG_ID_START]<15000||misdist_num[tag_id_recv-TAG_ID_START]>4) + if(abs(hex_dist-his_dist[tag_id_recv-TAG_ID_START])<15000||misdist_num[tag_id_recv-TAG_ID_START]>4) { int32_t filter_dist; misdist_num[tag_id_recv-TAG_ID_START]=0; -- Gitblit v1.9.3