zhyinch
2020-05-31 5b130136a057f2cec4df6b4f14165b503e8ac816
源码/核心板/Src/main.c
@@ -65,9 +65,9 @@
      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;   
   
@@ -109,10 +109,11 @@
UART_PushFrame(hbsend,16);
}
extern u8 g_start_sync_flag,usart_send_flag,anc_report_num;
u16 heartbeat_timer,poll_timer,sync_timer;
u16 heartbeat_timer,poll_timer;
int16_t sync_timer;
void IdleTask(void)
{
   g_start_sync_flag=0;
      main_logic();
         UART_CheckReceive();
      UART_CheckSend();
   if(heartbeat_timer>1000)
@@ -168,7 +169,7 @@
   
   while(1)
   {
   g_start_sync_flag=0;
   if(g_start_send_flag)
   {
      g_start_send_flag = 0;      
@@ -177,6 +178,7 @@
      IdleTask();      
if(g_com_map[DEV_ROLE]==0)
      Anchor_App();
   }
}