| | |
| | | DISCPOLL, |
| | | GETNEARMSG, |
| | | NEARPOLL, |
| | | }tag_state=GETNEARMSG; |
| | | }tag_state=NEARPOLL; |
| | | static dwt_config_t config = { |
| | | 2, /* Channel number. */ |
| | | DWT_PRF_64M, /* Pulse repetition frequency. */ |
| | |
| | | // } |
| | | tagslotpos=GetRandomSlotPos(rec_tagpos_binary|tagpos_binary); |
| | | tyncpoll_time = (tagslotpos--%max_slotpos)*slottime; |
| | | tag_state=GETNEARMSG; |
| | | tag_state=NEARPOLL; |
| | | } |
| | | // tyncpoll_time=0; |
| | | next_nearbase_num=0; |
| | |
| | | } |
| | | |
| | | // printf("%d,%d",temp_sync_timer2,temp_sync_timer1); |
| | | // #ifdef USART_INTEGRATE_OUTPUT |
| | | // usart_send[2] = 4;//æ£å¸¸æ¨¡å¼ |
| | | // usart_send[3] = report_num*6+2;//æ£å¸¸æ¨¡å¼ |
| | | // checksum = Checksum_u16(&usart_send[2],report_num*6+2); |
| | | // memcpy(&usart_send[4+report_num*6],&checksum,2); |
| | | // UART_PushFrame(usart_send,6+report_num*6); |
| | | // #endif |
| | | #ifdef USART_INTEGRATE_OUTPUT |
| | | usart_send[2] = 4;//æ£å¸¸æ¨¡å¼ |
| | | usart_send[3] = report_num*6+2;//æ£å¸¸æ¨¡å¼ |
| | | checksum = Checksum_u16(&usart_send[2],report_num*6+2); |
| | | memcpy(&usart_send[4+report_num*6],&checksum,2); |
| | | UART_PushFrame(usart_send,6+report_num*6); |
| | | #endif |
| | | // if(mainbase_lost_count>5) |
| | | // { |
| | | // //tag_state=DISCPOLL; |
| | |
| | | tyncpoll_time = (tagslotpos--%max_slotpos)*slottime; |
| | | } |
| | | |
| | | #ifdef USART_INTEGRATE_OUTPUT |
| | | usart_send[2] = 4;//æ£å¸¸æ¨¡å¼ |
| | | usart_send[3] = report_num*6+2;//æ£å¸¸æ¨¡å¼ |
| | | checksum = Checksum_u16(&usart_send[2],report_num*6+2); |
| | | memcpy(&usart_send[4+report_num*6],&checksum,2); |
| | | UART_PushFrame(usart_send,6+report_num*6); |
| | | #endif |
| | | } |
| | | |
| | | void Tag_App(void)//å鿍¡å¼(TAGæ ç¾) |
| | |
| | | dis_after_filter=dist_cm; |
| | | hex_dist = dist_cm+(int16_t)g_com_map[DIST_OFFSET]; |
| | | g_flag_Taggetdist[taglist_pos]=0; |
| | | if(hex_dist>-1000&&hex_dist<100000) |
| | | if(hex_dist>-1000&&hex_dist<200000) |
| | | { |
| | | if(abs(hex_dist-his_dist[taglist_pos])<1500||misdist_num[taglist_pos]>3) |
| | | { |