From d9a7770ba94decb726583ab824fe5fb0d0b4d85f Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期三, 01 七月 2020 20:36:10 +0800 Subject: [PATCH] 远程修改标签配置功能,好像有bug,map表会自动修改 --- 源码/核心板/Src/application/dw_app.c | 11 +++++++++-- 1 files changed, 9 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 5c15035..33a51d4 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" @@ -809,7 +809,7 @@ }else{ motorstate =0; } - tx_nearresp_msg[MOTORSTATE_INDEX]=motorstate; + if(new_tagid) { tagdist_list[taglist_pos]=0x1ffff; @@ -819,9 +819,16 @@ } tx_nearresp_msg[MAINBASE_INDEX]=flag_syncbase; tx_nearresp_msg[MESSAGE_TYPE_IDX]=NEAR_RESPONSE; - + tx_nearresp_msg[MOTORSTATE_INDEX]=(remotesend_state<<4)|motorstate; + if(remotesend_state) + { + memcpy(&tx_nearresp_msg[REMOTEPARA_INDEX],remotetag_para,REMOTEPARA_LEN); + dwt_writetxdata(22+REMOTEPARA_LEN, tx_nearresp_msg, 0);//写入发送数据 + dwt_writetxfctrl(22+REMOTEPARA_LEN, 0);//设定发送长度 + }else{ dwt_writetxdata(22, tx_nearresp_msg, 0);//写入发送数据 dwt_writetxfctrl(22, 0);//设定发送长度 + } result = dwt_starttx(DWT_START_TX_DELAYED | DWT_RESPONSE_EXPECTED);//延迟发送,等待接收 battary = rx_buffer[BATTARY_IDX]; -- Gitblit v1.9.3