| | |
| | | return max_slotpos-1; |
| | | } |
| | | u8 test=0; |
| | | u8 anclost_times=0; |
| | | u8 anclost_times=0,usartoutput_count,usartoutput_notenough=0; |
| | | u8 exsistbase_list[MAX_NEARBASE_NUM],report_num,get_newbase=0,rec_extratag_battary; |
| | | u16 temp_sync_timer1,temp_sync_timer2,rec_extratag_id; |
| | | int32_t rec_extratag_dist; |
| | |
| | | dwt_setrxaftertxdelay(POLL_TX_TO_RESP_RX_DLY_UUS); //设置åéåå¼å¯æ¥æ¶ï¼å¹¶è®¾å®å»¶è¿æ¶é´ |
| | | dwt_setrxtimeout(RESP_RX_TIMEOUT_UUS); |
| | | tag_succ_times = 0; |
| | | usartoutput_count = 0; |
| | | GPIO_WriteBit(GPIOA, GPIO_Pin_10, Bit_SET); |
| | | if(next_nearbase_num>=MAX_NEARBASE_NUM) |
| | | { |
| | |
| | | checksum = Checksum_u16(&usart_send[2],17); |
| | | memcpy(&usart_send[19],&checksum,2); |
| | | UART_PushFrame(usart_send,21); |
| | | usartoutput_count++; |
| | | #endif |
| | | } |
| | | if(rec_extratag_dist!=0x1ffff&&rec_extratag_dist!=0&&rx_buffer[GROUP_ID_IDX]!=supergroupid) |
| | |
| | | checksum = Checksum_u16(&usart_send[2],17); |
| | | memcpy(&usart_send[19],&checksum,2); |
| | | UART_PushFrame(usart_send,21); |
| | | usartoutput_count++; |
| | | #endif |
| | | |
| | | //dwt_setdelayedtrxtime(final_tx_time);//设置finalå
åéæ¶é´T5 |
| | |
| | | // }else{ |
| | | // anclost_times=0; |
| | | // } |
| | | if(usartoutput_count>=2) |
| | | { |
| | | usartoutput_notenough = 0; |
| | | }else{ |
| | | tyncpoll_time = (tagslotpos--%max_slotpos)*slottime; |
| | | if(usartoutput_notenough++>10) |
| | | { |
| | | SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软å¤ä½åå°bootloader |
| | | } |
| | | } |
| | | dwt_forcetrxoff(); |
| | | dwt_write32bitreg(SYS_STATUS_ID, SYS_STATUS_ALL_RX_ERR| SYS_STATUS_TXFRS |SYS_STATUS_RXFCG); |
| | | } |
| | |
| | | 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]=0;//(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{ |
| | | if(taglist_pos==1) |
| | | { |
| | | memcpy(&tx_nearresp_msg[EXTRA_TAGID_INDEX], &tagid_list[0], 2); |
| | |
| | | } |
| | | dwt_writetxdata(28, tx_nearresp_msg, 0);//åå
¥åéæ°æ® |
| | | dwt_writetxfctrl(28, 0);//设å®åéé¿åº¦ |
| | | } |
| | | // } |
| | | result = dwt_starttx(DWT_START_TX_DELAYED | DWT_RESPONSE_EXPECTED);//å»¶è¿åéï¼çå¾
æ¥æ¶ |
| | | |
| | | |