| | |
| | | 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; |
| | |
| | | }else{ |
| | | memcpy(&tx_nearresp_msg[DIST_IDX], &tagdist_list[taglist_pos], 4); |
| | | } |
| | | 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);//å»¶è¿åéï¼çå¾
æ¥æ¶ |
| | | |
| | | |