| | |
| | | DISCPOLL, |
| | | GETNEARMSG, |
| | | NEARPOLL, |
| | | }tag_state=GETNEARMSG; |
| | | }tag_state=NEARPOLL; |
| | | static dwt_config_t config = { |
| | | 2, /* Channel number. */ |
| | | DWT_PRF_64M, /* Pulse repetition frequency. */ |
| | |
| | | u32 start_poll; |
| | | u8 i,j,getsync_flag=0,timeout; |
| | | dwt_setrxaftertxdelay(POLL_TX_TO_RESP_RX_DLY_UUS); //设置发送后开启接收,并设定延迟时间 |
| | | dwt_setrxtimeout(RESP_RX_TIMEOUT_UUS); |
| | | dwt_setrxtimeout(10000); |
| | | tag_succ_times = 0; |
| | | //GPIO_WriteBit(GPIOA, GPIO_Pin_10, Bit_SET); |
| | | if(next_nearbase_num>=MAX_NEARBASE_NUM) |
| | |
| | | lastsync_timer=sync_timer; |
| | | offsettimeus=ancsync_time-current_count*LPTIMER_LSB+offset; |
| | | SetNextPollTime(tyncpoll_time); |
| | | if(rec_remotepara_state==1) |
| | | { |
| | | memcpy(rec_remotepara,&rx_buffer[REMOTEPARA_INDEX],REMOTEPARA_LEN); |
| | | memcpy(&g_com_map[COM_INTERVAL],&rec_remotepara[0],8); |
| | | memcpy(&g_com_map[POWER],&rec_remotepara[8],10); |
| | | if(g_com_map[COM_INTERVAL]>0&&g_com_map[COM_INTERVAL]<1000&&g_com_map[POWER]<67&&g_com_map[POWER]>0) |
| | | {save_com_map_to_flash(); |
| | | delay_ms(100); |
| | | } |
| | | NVIC_SystemReset(); |
| | | } |
| | | // if(rec_remotepara_state==1) |
| | | // { |
| | | // memcpy(rec_remotepara,&rx_buffer[REMOTEPARA_INDEX],REMOTEPARA_LEN); |
| | | // memcpy(&g_com_map[COM_INTERVAL],&rec_remotepara[0],8); |
| | | // memcpy(&g_com_map[POWER],&rec_remotepara[8],10); |
| | | // if(g_com_map[COM_INTERVAL]>0&&g_com_map[COM_INTERVAL]<1000&&g_com_map[POWER]<67&&g_com_map[POWER]>0) |
| | | // {save_com_map_to_flash(); |
| | | // delay_ms(100); |
| | | // } |
| | | // NVIC_SystemReset(); |
| | | // } |
| | | }else{ |
| | | rec_nearbasepos=FindNearBasePos(rec_nearbaseid); |
| | | |