| | |
| | | memcpy(&sync_timer,&rx_buffer[ANCTIMEMS],2); |
| | | memcpy(&tmp_time,&rx_buffer[ANCTIMEUS],2); |
| | | current_count=HAL_LPTIM_ReadCounter(&hlptim1); |
| | | memcpy(&rec_tagslotpos,&rx_buffer[TAGSLOTPOS],2); |
| | | // memcpy(&rec_tagslotpos,&rx_buffer[TAGSLOTPOS],2); |
| | | tmp_time=tmp_time+450; |
| | | if(tmp_time>999) |
| | | { |
| | |
| | | {sync_timer=0;} |
| | | } |
| | | ancsync_time=((sync_timer)*1000+tmp_time); |
| | | // SyncAncUpdate(rec_nearbaseid,ancsync_time,rec_tagslotpos); |
| | | SyncAncUpdate(rec_nearbaseid,ancsync_time,rec_tagslotpos); |
| | | // TIM3->CNT=tmp_time; |
| | | // if(tagslotpos>max_slotpos) |
| | | // tagslotpos=tagslotpos%(max_slotpos+1); |
| | |
| | | memcpy(&sync_timer,&rx_buffer[ANCTIMEMS],2); |
| | | memcpy(&tmp_time,&rx_buffer[ANCTIMEUS],2); |
| | | current_count=HAL_LPTIM_ReadCounter(&hlptim1); |
| | | memcpy(&rec_tagslotpos,&rx_buffer[TAGSLOTPOS],2); |
| | | // memcpy(&rec_tagslotpos,&rx_buffer[TAGSLOTPOS],2); |
| | | tmp_time=tmp_time+450; |
| | | if(tmp_time>999) |
| | | { |
| | |
| | | j=0; |
| | | if(sync_anc_losttime!=0) |
| | | { |
| | | NextSlotDelayMs(0); |
| | | rec_tagslotpos=HAL_LPTIM_ReadCounter(&hlptim1)%bigslot_num; |
| | | SetLPTimer(0); |
| | | } |
| | | // tyncpoll_time=0; |
| | | next_nearbase_num=0; |