| | |
| | | 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; |
| | | extern uint8_t g_pairstart,getrange_success; |
| | | u8 neartimout_timer=0,flag_syncbase=0,flag_newsecond=0; |
| | | extern u16 tyncpoll_time,target_time; |
| | | extern uint32_t synclost_timer,current_syncid; |
| | |
| | | //GPIO_WriteBit(GPIOA, GPIO_Pin_10, Bit_RESET); |
| | | if(sync_timer>=1000) |
| | | { |
| | | // if(getrange_success==0) |
| | | // { |
| | | // NVIC_SystemReset(); |
| | | // } |
| | | flag_newsecond=1; |
| | | //GPIO_WriteBit(GPIOA, GPIO_Pin_10, Bit_SET); |
| | | sync_timer=0; |
| | | TagListUpdate(); |
| | | } |
| | | |
| | | if(g_Resttimer++>2000) |
| | | if(g_Resttimer++>5000) |
| | | { |
| | | // NVIC_SystemReset(); |
| | | NVIC_SystemReset(); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | #ifdef USART_INTEGRATE_OUTPUT |
| | | if(sync_timer==target_time) |
| | | if(sync_timer%g_com_map[COM_INTERVAL]==0) |
| | | { |
| | | |
| | | usart_send_flag=1; |
| | |
| | | } |
| | | if(synclost_timer>SYNCLOST_TIME) |
| | | { |
| | | //flag_syncbase=1; |
| | | flag_syncbase=1; |
| | | } |
| | | |
| | | if(flag_syncbase) //鏈ā鍧楁槸鍚屾鍩虹珯 |
| | |
| | | }else{ //鏍囩鍚屾澶勭悊 |
| | | if(sync_timer==target_time) |
| | | { |
| | | |
| | | last_polltime=sync_timer; |
| | | // GPIO_WriteBit(GPIOA, GPIO_Pin_9, Bit_SET); |
| | | g_start_send_flag=1; |
| | |
| | | // } |
| | | |
| | | } |
| | | void HardFalut_Handler(void) |
| | | { |
| | | while(1) |
| | | { |
| | | NVIC_SystemReset(); |
| | | } |
| | | |
| | | } |
| | | |