| | |
| | | save_com_map_to_flash(); |
| | | #endif |
| | | OUT485_ENABLE; |
| | | g_com_map[VERSION] = 0x010c; |
| | | g_com_map[VERSION] = 0x010e; |
| | | dev_id = g_com_map[DEV_ID]; |
| | | slottime=ceil((double)g_com_map[MAX_REPORT_ANC_NUM]/3)+1; |
| | | slottime=ceil((double)g_com_map[MAX_REPORT_ANC_NUM]/4)+4; |
| | | max_slotpos=g_com_map[COM_INTERVAL]/slottime; |
| | | tyncpoll_time=(g_com_map[DEV_ID]%max_slotpos)*slottime; |
| | | |
| | |
| | | u16 heartbeat_timer,poll_timer,sync_timer; |
| | | void IdleTask(void) |
| | | { |
| | | g_start_sync_flag=0; |
| | | main_logic(); |
| | | UART_CheckReceive(); |
| | | UART_CheckSend(); |
| | | if(heartbeat_timer>1000) |
| | |
| | | |
| | | while(1) |
| | | { |
| | | |
| | | g_start_sync_flag=0; |
| | | if(g_start_send_flag) |
| | | { |
| | | g_start_send_flag = 0; |
| | |
| | | IdleTask(); |
| | | if(g_com_map[DEV_ROLE]==0) |
| | | Anchor_App(); |
| | | |
| | | } |
| | | } |
| | | |