| | |
| | | extern uint16_t sync_timer; |
| | | u16 tmp_time; |
| | | extern float dw_vbat; |
| | | extern u16 slottime,max_slotnum,current_slotpos,tyncpoll_time; |
| | | void Tag_App(void)//å鿍¡å¼(TAGæ ç¾) |
| | | { |
| | | uint32_t frame_len; |
| | |
| | | // deca_sleep(10); |
| | | } |
| | | // dwt_entersleep(); |
| | | // if(tag_succ_times<g_com_map[MIN_REPORT_ANC_NUM]) |
| | | // { |
| | | // //poll_timer +=time32_incr&0x7+3; |
| | | // } |
| | | if(tag_succ_times<1) |
| | | { |
| | | tyncpoll_time=(current_slotpos--%max_slotnum)*slottime; |
| | | } |
| | | |
| | | /* Execute a delay between ranging exchanges. */ |
| | | |
| | |
| | | #define TDFILTER |
| | | //#define CHECK_UID |
| | | extern uint8_t UID_ERROR; |
| | | u8 misdist_num[TAG_NUM_IN_SYS]; |
| | | void Anchor_App(void) |
| | | { |
| | | uint32_t frame_len; |
| | | uint32_t resp_tx_time; |
| | | static u8 misdist_num; |
| | | /* Clear reception timeout to start next ranging process. */ |
| | | dwt_setrxtimeout(0);//è®¾å®æ¥æ¶è¶
æ¶æ¶é´ï¼0使²¡æè¶
æ¶æ¶é´ |
| | | |
| | |
| | | hex_dist = dist_cm+(int16_t)g_com_map[DIST_OFFSET]*10; |
| | | if(tag_id_recv-TAG_ID_START<=TAG_NUM_IN_SYS) |
| | | { |
| | | if(hex_dist-his_dist[tag_id_recv-TAG_ID_START]<15000||misdist_num>4) |
| | | {int32_t filter_dist; |
| | | misdist_num=0; |
| | | if(abs(hex_dist-his_dist[tag_id_recv-TAG_ID_START])<15000||misdist_num[tag_id_recv-TAG_ID_START]>4) |
| | | { |
| | | int32_t filter_dist; |
| | | misdist_num[tag_id_recv-TAG_ID_START]=0; |
| | | if(hex_dist<1000000&&hex_dist>-10000) |
| | | { |
| | | #ifdef TDFILTER |
| | |
| | | //dis_after_filter = LP_Frac_Update(p_Dis_Filter, dist_cm); |
| | | } |
| | | |
| | | }else{ |
| | | misdist_num++; |
| | | } |
| | | else{ |
| | | misdist_num[tag_id_recv-TAG_ID_START]++; |
| | | } |
| | | } |
| | | } |