| | |
| | | u8 neartimout_timer=0,flag_syncbase=0,flag_newsecond=0; |
| | | extern u16 tyncpoll_time,target_time; |
| | | extern uint32_t synclost_timer,current_syncid; |
| | | u8 needanchorrx=1; |
| | | void TIM3_IRQHandler(void) //TIM3?? |
| | | { |
| | | if (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET) //??TIM3???????? |
| | |
| | | |
| | | if(g_Resttimer++>10000) |
| | | { |
| | | // NVIC_SystemReset(); |
| | | NVIC_SystemReset(); |
| | | } |
| | | |
| | | |
| | |
| | | flag_syncbase=1; |
| | | } |
| | | |
| | | if(1)//flag_syncbase) //鏈ā鍧楁槸鍚屾鍩虹珯 |
| | | if(flag_syncbase) //鏈ā鍧楁槸鍚屾鍩虹珯 |
| | | { |
| | | if(sync_timer==995) |
| | | { |
| | | current_syncid = g_com_map[DEV_ID]; |
| | | sync_seq=0; |
| | | SyncPoll(sync_seq,current_syncid); |
| | | // needanchorrx = 1; |
| | | } |
| | | } |
| | | }else{ //鏍囩鍚屾澶勭悊 |
| | |
| | | |
| | | } |
| | | } |
| | | u32 status_reg; |
| | | |
| | | void EXTI0_IRQHandler(void) |
| | | { |
| | | if(EXTI_GetITStatus(EXTI_Line0)!= RESET) |
| | | { |
| | | status_reg = dwt_read32bitreg(SYS_STATUS_ID); |
| | | EXTI_ClearITPendingBit(EXTI_Line0); |
| | | Anchor_App(); |
| | | needanchorrx = 1; |
| | | } |
| | | } |
| | | void USART1_IRQHandler(void) |
| | | { |
| | | if(USART_GetITStatus(EXT_UART, USART_IT_RXNE) != RESET)//????????? |