From 0f9a5a119401d9e08cefc4b9cb7f700988a69abe Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期六, 04 六月 2022 17:01:05 +0800 Subject: [PATCH] V1.70修改免报距离不生效bug --- 源码/核心板/Src/application/dw_app.c | 9 +++++++-- 1 files changed, 7 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 4f01d7a..dac4566 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" @@ -438,6 +438,7 @@ } TIM3->CNT=tmp_time; } + if(g_com_map[DEV_ROLE]) current_slotnum=temp_sync_timer1/g_com_map[COM_INTERVAL]; // if(tagslotpos>max_slotpos) // tagslotpos=tagslotpos%(max_slotpos+1); @@ -885,7 +886,11 @@ memcpy(&tx_nearresp_msg[DIST_IDX], &tagdist_list[taglist_pos], 4); } motorstate =0; - if(tagdist_list[taglist_pos]<g_com_map[ALARM_DISTANCE2]) + + if(tagdist_list[taglist_pos]<g_com_map[ALARM_DISTANCE1]||tagdist_list[taglist_pos]==0) + { + motorstate =0; + }else if(tagdist_list[taglist_pos]<g_com_map[ALARM_DISTANCE2]) { if(flag_tag_distsmooth[taglist_pos]) {motorstate =2; @@ -900,7 +905,7 @@ motorstate =0; } } - tx_nearresp_msg[GROUP_ID_IDX] = group_id; + tx_nearresp_msg[GROUP_ID_IDX] = group_id; tx_nearresp_msg[MAINBASE_INDEX]=flag_syncbase; tx_nearresp_msg[MESSAGE_TYPE_IDX]=NEAR_RESPONSE; tx_nearresp_msg[MOTORSTATE_INDEX]=motorstate;//(remotesend_state<<4)|motorstate; -- Gitblit v1.9.3