From 823ed24e060e06c65fd0e601d1c5856fa7d7d37a Mon Sep 17 00:00:00 2001 From: yincheng.zhong <634916154@qq.com> Date: 星期一, 31 十月 2022 16:08:51 +0800 Subject: [PATCH] V1.34 1增加超级小组0xff,这个小组的标签会和小车基站测距。 --- Src/application/dw_app.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Src/application/dw_app.c b/Src/application/dw_app.c index 4a135d9..62b0a5a 100644 --- a/Src/application/dw_app.c +++ b/Src/application/dw_app.c @@ -30,6 +30,7 @@ #include "beep.h" #include "modbus.h" +#define SUPERTAG_GROUP 0xff #define USART_INTEGRATE_OUTPUT /*------------------------------------ Marcos ------------------------------------------*/ /* Inter-ranging delay period, in milliseconds. */ @@ -78,7 +79,7 @@ NEARPOLL, }tag_state=GETNEARMSG; static dwt_config_t config = { - 5, /* Channel number. */ + 5, /* Channel number. */ DWT_PRF_64M, /* Pulse repetition frequency. */ DWT_PLEN_128, /* Preamble length. */ DWT_PAC8, /* Preamble acquisition chunk size. Used in RX only. */ @@ -379,7 +380,7 @@ dwt_readrxdata(rx_buffer, frame_len, 0); //读取接收数据 dwt_setrxtimeout(0);//DELAY_BETWEEN_TWO_FRAME_UUS*(nearbase_num+1-recbase_num)+10);//设定接收超时时间,0位没有超时时间 dwt_rxenable(0);//打开接收 - if (rx_buffer[MESSAGE_TYPE_IDX] == NEAR_RESPONSE&&!memcmp(&rx_buffer[TAG_ID_IDX],&dev_id,2)&&rx_buffer[GROUP_ID_IDX]==group_id) //判断接收到的数据是否是response数据 + if (rx_buffer[MESSAGE_TYPE_IDX] == NEAR_RESPONSE&&!memcmp(&rx_buffer[TAG_ID_IDX],&dev_id,2)&&(group_id == SUPERTAG_GROUP||rx_buffer[GROUP_ID_IDX]==group_id)) //判断接收到的数据是否是response数据 { u16 rec_nearbaseid,rec_nearbasepos; poll_tx_ts = get_tx_timestamp_u64(); //获得POLL发送时间T1 resp_rx_ts = get_rx_timestamp_u64(); //获得RESPONSE接收时间T4 -- Gitblit v1.9.3