From aaf7e4ef5c1aa0535940531f20e4846cbcd39b69 Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期一, 04 十一月 2019 19:48:15 +0800 Subject: [PATCH] Merge branch '基站测距' into ALPHAV1 --- 源码/核心板/Src/application/dw_app.c | 5 +++-- 1 files changed, 3 insertions(+), 2 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 83dcf89..6825d03 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" @@ -251,6 +251,7 @@ * For initialisation, DW1000 clocks must be temporarily set to crystal speed. After initialisation SPI rate can be increased for optimum * performance. */ Reset_DW1000();//重启DW1000 /* Target specific drive of RSTn line into DW1000 low for a period. */ + Spi_ChangePrescaler(SPIx_PRESCALER_SLOW); //设置为快速模式 dwt_initialise(DWT_LOADUCODE);//初始化DW1000 Spi_ChangePrescaler(SPIx_PRESCALER_FAST); //设置为快速模式 @@ -337,7 +338,7 @@ for(i=0;i<g_com_map[MAX_REPORT_ANC_NUM];i++) { /* Write frame data to DW1000 and prepare transmission. See NOTE 7 below. */ - tx_poll_msg[ANC_TYPE_IDX] = i-1; + tx_poll_msg[ANC_TYPE_IDX] = i; dwt_writetxdata(sizeof(tx_poll_msg), tx_poll_msg, 0);//将Poll包数据传给DW1000,将在开启发送时传出去 dwt_writetxfctrl(sizeof(tx_poll_msg), 0);//设置超宽带发送数据长度 @@ -425,7 +426,7 @@ usart_send[4] = frame_seq_nb;//数据段长度 memcpy(&usart_send[5],&dev_id,2); memcpy(&usart_send[7],&rx_buffer[ANCHOR_ID_IDX],2); - hex_dist = anchor_dist_last_frm[0];; + hex_dist = anchor_dist_last_frm[0]+(int16_t)g_com_map[DIST_OFFSET]; memcpy(&usart_send[9],&hex_dist,4); usart_send[13] = battary; usart_send[14] = button; -- Gitblit v1.9.3