zhyinch
2022-04-11 d5777a0e26f94314af6408c1dff8d34abf8ff9fc
Ô´Âë/ºËÐİå/Src/application/dw_app.c
@@ -855,19 +855,6 @@
         dwt_setrxaftertxdelay(RESP_TX_TO_FINAL_RX_DLY_UUS+(rec_nearbase_num+1-ancrec_nearbasepos)*DELAY_BETWEEN_TWO_FRAME_UUS);//设置发送完成后开启接收延迟时间
         dwt_setrxtimeout(FINAL_RX_TIMEOUT_UUS);//接收超时时间
         
         if(tagdist_list[taglist_pos]<g_com_map[ALARM_DISTANCE1])
         {
            motorstate =0;
         }else if(tagdist_list[taglist_pos]<g_com_map[ALARM_DISTANCE2])
         {
            motorstate =2;
         }else if(tagdist_list[taglist_pos]<g_com_map[ALARM_DISTANCE3])
         {
            motorstate =1;
         }else{
            motorstate =0;
         }
         if(new_tagid)
         {
            tagdist_list[taglist_pos]=0x1ffff;
@@ -875,19 +862,23 @@
         }else{
            memcpy(&tx_nearresp_msg[DIST_IDX], &tagdist_list[taglist_pos], 4);
         }
            tx_nearresp_msg[GROUP_ID_IDX] = group_id;
         motorstate =0;
      if(tagdist_list[taglist_pos]<g_com_map[ALARM_DISTANCE2])
         {
                    motorstate =2;
         }else if(tagdist_list[taglist_pos]<g_com_map[ALARM_DISTANCE3])
         {
             motorstate =1;
         }
      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]=(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{
         tx_nearresp_msg[MOTORSTATE_INDEX]=motorstate;//(remotesend_state<<4)|motorstate;
         tx_nearresp_msg[MOTORSTATE_INDEX]&=0x0f;
         dwt_writetxdata(22, tx_nearresp_msg, 0);//写入发送数据
         dwt_writetxfctrl(22, 0);//设定发送长度
         }
      //   }
         result = dwt_starttx(DWT_START_TX_DELAYED | DWT_RESPONSE_EXPECTED);//延迟发送,等待接收