| | |
| | | if (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET) //??TIM3???????? |
| | | { |
| | | TIM_ClearITPendingBit(TIM3, TIM_IT_Update ); //??TIMx?????? |
| | | time32_incr++; |
| | | g_UWB_com_interval++; |
| | | |
| | | time32_incr++; |
| | | heartbeat_timer++; |
| | | poll_timer++; |
| | | |
| | | if(tag_timer++>=g_com_map[COM_INTERVAL]) |
| | | {tag_timer=0;} |
| | | sync_timer++; |
| | | |
| | | if(sync_timer>=1010) |
| | | {sync_timer=0;} |
| | | |
| | | if(g_Resttimer++>2000) |
| | | { |
| | | NVIC_SystemReset(); |
| | | } |
| | | |
| | | |
| | | sync_timer++; |
| | | |
| | | |
| | | if(!g_com_map[DEV_ROLE]) //鍩虹珯 |
| | | { |
| | |
| | | TagDistClear(); |
| | | if(g_com_map[ALARM_DEV]!=0) |
| | | main_logic(); |
| | | if(sync_timer==10) |
| | | { |
| | | GPIO_WriteBit(GPIOA, GPIO_Pin_9, Bit_SET); |
| | | }else{ |
| | | GPIO_WriteBit(GPIOA, GPIO_Pin_9, Bit_RESET); |
| | | } |
| | | |
| | | if(sync_timer>500&&dev_id!=0) |
| | | { |
| | | sync_seq=0xff; |
| | | } |
| | | if(sync_timer>=1010) |
| | | { |
| | | sync_timer=0; |
| | | if(dev_id==0) |
| | | |
| | | if(sync_timer==0) |
| | | { |
| | | SyncPoll(0); |
| | | TagListUpdate(); |
| | | if(dev_id==0) |
| | | SyncPoll(0); |
| | | } |
| | | } |
| | | }else{ //鏍囩鍚屾澶勭悊 |
| | | if(sync_timer>=1010) |
| | | {sync_timer=0;} |
| | | if((sync_timer-10)%g_com_map[COM_INTERVAL]==tyncpoll_time) |
| | | if((sync_timer-10)%g_com_map[COM_INTERVAL]==tyncpoll_time&&sync_timer>=10) |
| | | { |
| | | GPIO_WriteBit(GPIOA, GPIO_Pin_9, Bit_SET); |
| | | } |
| | | if((sync_timer-10)%g_com_map[COM_INTERVAL]==tyncpoll_time) |
| | | { |
| | | g_start_send_flag=1; |
| | | } |
| | | |