From ae53ad9142f8092693118eac64a138d050082afa Mon Sep 17 00:00:00 2001 From: yincheng.zhong <634916154@qq.com> Date: 星期二, 25 十月 2022 17:11:46 +0800 Subject: [PATCH] 测试延迟差=0 精度 --- 源码/核心板/Src/application/dw_app.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 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 e4d44e8..e363661 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" @@ -30,7 +30,7 @@ #include "beep.h" #include "modbus.h" //#define DEBUG_OUTPUT -#define TDFILTER +//#define TDFILTER //#define CONSTANT_FILTER /*------------------------------------ Marcos ------------------------------------------*/ /* Inter-ranging delay period, in milliseconds. */ @@ -49,7 +49,7 @@ #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 420 /* Receive response timeout. See NOTE 5 below. */ #define RESP_RX_TIMEOUT_UUS 600 @@ -339,7 +339,7 @@ C = dia->maxGrowthCIR; firstpath_power=10* log10((F1*F1+F2*F2+F3*F3)/(N*N))-A; -// rx_power=10*log10(C*B/(N*N))-A; + rx_power=10*log10(C*B/(N*N))-A; // min_power = - 10 * log10((F1 *F1 + F2 * F2 + F3 * F3) / (C *B)); return min_power; @@ -507,7 +507,8 @@ { g_Tagdist[anc_id_recv]= hex_dist2; g_flag_Taggetdist[anc_id_recv]=0; - + Modbus_HoldReg[anc_id_recv*2]=hex_dist2>>16; + Modbus_HoldReg[anc_id_recv*2+1]=hex_dist2; if(!g_com_map[MODBUS_MODE]) { hex_dist2 = hex_dist2; @@ -524,6 +525,7 @@ checksum = Checksum_u16(&usart_send[2],17); memcpy(&usart_send[19],&checksum,2); UART_PushFrame(usart_send,21); + } } // memcpy(&Modbus_HoldReg[anc_id_recv*2],&hex_dist,4); @@ -757,6 +759,7 @@ usart_send[13] = battary; usart_send[14] = button; usart_send[15] = firstpath_power; + usart_send[16] = rx_power; checksum = Checksum_u16(&usart_send[2],17); memcpy(&usart_send[19],&checksum,2); UART_PushFrame(usart_send,21); -- Gitblit v1.9.3