| | |
| | | g_start_sync_flag=0; |
| | | UART_CheckReceive(); |
| | | UART_CheckSend(); |
| | | if( memcmp(g_com_map2,g_com_map,COM_MAP_SIZE)!=0) |
| | | { |
| | | SendAnchorState(SM_MAPERROR); |
| | | delay_ms(100); |
| | | SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //杞浣嶅洖鍒癰ootloader |
| | | } |
| | | if(g_com_map[MAP_SIGN_INDEX]!=0x55AA) |
| | | { |
| | | SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //杞浣嶅洖鍒癰ootloader |
| | | } |
| | | if(heartbeat_timer>1000) |
| | | { |
| | | heartbeat_timer=0; |
| | | if(g_com_map[HEARTBEAT]&&g_com_map[DEV_ROLE]==0) |
| | | HeatBeat(); |
| | | } |
| | | // if( memcmp(g_com_map2,g_com_map,COM_MAP_SIZE)!=0) |
| | | // { |
| | | // SendAnchorState(SM_MAPERROR); |
| | | // delay_ms(100); |
| | | // SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //杞浣嶅洖鍒癰ootloader |
| | | // } |
| | | // if(g_com_map[MAP_SIGN_INDEX]!=0x55AA) |
| | | // { |
| | | // SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //杞浣嶅洖鍒癰ootloader |
| | | // } |
| | | // if(heartbeat_timer>1000) |
| | | // { |
| | | // heartbeat_timer=0; |
| | | // if(g_com_map[HEARTBEAT]&&g_com_map[DEV_ROLE]==0) |
| | | // HeatBeat(); |
| | | // } |
| | | |
| | | } |
| | | uint16_t temp; |
| | |
| | | { |
| | | Device_Init(); |
| | | Program_Init(); |
| | | module_power = 67; |
| | | Dw1000_Init(); |
| | | delay_ms(10); |
| | | Dw1000_App_Init(); |
| | |
| | | usart_send[0]=0x55; |
| | | usart_send[1]=0xAA; |
| | | Modbus_RegMap(); |
| | | g_com_map[DEV_ROLE] = 1; |
| | | while(1) |
| | | { |
| | | if(g_com_map[0] != 0x55AA) |