| | |
| | | uint16_t sysscal; |
| | | u16 tag_recv_timer, tag_timer,last_polltime; |
| | | extern uint16_t g_Resttimer,heartbeat_timer,sync_timer; |
| | | extern uint8_t g_pairstart,getrange_success; |
| | | extern uint8_t g_pairstart,getrange_success,dissucc_times; |
| | | u8 neartimout_timer=0,flag_syncbase=0,flag_newsecond=0; |
| | | extern u16 tyncpoll_time,target_time; |
| | | extern u16 tyncpoll_time,target_time,success_ancid; |
| | | extern uint32_t synclost_timer,current_syncid; |
| | | void TIM3_IRQHandler(void) //TIM3?? |
| | | { |
| | |
| | | //GPIO_WriteBit(GPIOA, GPIO_Pin_10, Bit_RESET); |
| | | if(sync_timer>=1000) |
| | | { |
| | | if(getrange_success==0) |
| | | { |
| | | NVIC_SystemReset(); |
| | | } |
| | | // if(getrange_success==0) |
| | | // { |
| | | // NVIC_SystemReset(); |
| | | // } |
| | | flag_newsecond=1; |
| | | //GPIO_WriteBit(GPIOA, GPIO_Pin_10, Bit_SET); |
| | | sync_timer=0; |
| | | dissucc_times = 0; |
| | | success_ancid = 0; |
| | | TagListUpdate(); |
| | | } |
| | | |
| | | if(g_Resttimer++>20000) |
| | | if(g_Resttimer++>10000) |
| | | { |
| | | NVIC_SystemReset(); |
| | | } |
| | |
| | | flag_syncbase=1; |
| | | } |
| | | |
| | | if(flag_syncbase) //鏈ā鍧楁槸鍚屾鍩虹珯 |
| | | { |
| | | if(sync_timer==995) |
| | | { |
| | | current_syncid = g_com_map[DEV_ID]; |
| | | sync_seq=0; |
| | | SyncPoll(sync_seq,current_syncid); |
| | | } |
| | | } |
| | | // if(flag_syncbase) //鏈ā鍧楁槸鍚屾鍩虹珯 |
| | | // { |
| | | // if(sync_timer==995) |
| | | // { |
| | | // current_syncid = g_com_map[DEV_ID]; |
| | | // sync_seq=0; |
| | | // SyncPoll(sync_seq,current_syncid); |
| | | // } |
| | | // } |
| | | }else{ //鏍囩鍚屾澶勭悊 |
| | | if(sync_timer==target_time) |
| | | if(sync_timer%20==0) |
| | | { |
| | | |
| | | last_polltime=sync_timer; |
| | | // last_polltime=sync_timer; |
| | | // GPIO_WriteBit(GPIOA, GPIO_Pin_9, Bit_SET); |
| | | g_start_send_flag=1; |
| | | } |
| | | // if(sync_timer>900&&(dissucc_flag2&dissucc_flag2)==0) |
| | | // { |
| | | // if(sync_timer%10==0) |
| | | // g_start_send_flag=1; |
| | | // } |
| | | |
| | | } |
| | | |
| | |
| | | // } |
| | | |
| | | } |
| | | void HardFalut_Handler(void) |
| | | { |
| | | while(1) |
| | | { |
| | | NVIC_SystemReset(); |
| | | } |
| | | |
| | | } |
| | | |