| | |
| | | { |
| | | g_com_map[COM_INTERVAL]=100; |
| | | } |
| | | g_com_map[VERSION] = 0x011c; |
| | | g_com_map[VERSION] = 0x011f; |
| | | dev_id = g_com_map[DEV_ID]; |
| | | slottime=ceil((double)g_com_map[MAX_REPORT_ANC_NUM]*SLOT_SCALE)+3; |
| | | max_slotpos=g_com_map[COM_INTERVAL]/slottime; |
| | |
| | | { |
| | | UART_PushFrame(hbsend,16); |
| | | } |
| | | uint16_t temp; |
| | | float dw_vbat; |
| | | void StartUpTest(void) |
| | | { |
| | | temp=dwt_readtempvbat(1); |
| | | dw_vbat=(float)((temp&0xff)-173)/173+3.3; |
| | | if(dw_vbat<2.8) |
| | | { |
| | | SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //杞浣嶅洖鍒癰ootloader |
| | | } |
| | | } |
| | | extern u8 g_start_sync_flag,usart_send_flag,anc_report_num; |
| | | u16 heartbeat_timer,poll_timer; |
| | | int16_t sync_timer; |
| | |
| | | |
| | | UART_CheckReceive(); |
| | | UART_CheckSend(); |
| | | |
| | | if(heartbeat_timer>1000) |
| | | { |
| | | heartbeat_timer=0; |
| | |
| | | } |
| | | if(flag_newsecond) |
| | | { |
| | | uint32_t temp23; |
| | | temp23 = dwt_read32bitreg(CHAN_CTRL_ID) ; |
| | | if(temp23!=0x4A480022) |
| | | { |
| | | temp23 = dwt_read32bitreg(CHAN_CTRL_ID) ; |
| | | if(temp23!=0x4A480022) |
| | | { |
| | | NVIC_SystemReset(); |
| | | } |
| | | } |
| | | flag_newsecond=0; |
| | | tagpos_binary=0; |
| | | memcpy(ancidlist_send,ancidlist_rec,ancidlist_num*2); |
| | |
| | | { |
| | | |
| | | Device_Init(); |
| | | //StartUpTest(); |
| | | Program_Init(); |
| | | Dw1000_Init(); |
| | | delay_ms(10); |