zhyinch
2019-11-18 de54091782f3fef4a88df90327ea0243db97361b
源码/核心板/Src/main.c
@@ -11,6 +11,7 @@
#include "global_param.h"
#include "ADC.h"
//#define DEBUG_MODE
void Device_Init(void)
{
@@ -52,19 +53,27 @@
   parameter_init();
   //deca_sleep(1000);
   HeartBeatInit();
   dev_id = g_com_map[DEV_ID];
//   g_com_map[DEV_ROLE]=1;
//      g_com_map[DEV_ID]=1;
//   g_com_map[COM_INTERVAL]=10;
   OUT485_ENABLE;
   g_com_map[VERSION] = 0x0106;
#ifdef DEBUG_MODE
   g_com_map[COM_INTERVAL]=50;
   g_com_map[MAX_REPORT_ANC_NUM]=3;
   g_com_map[DEV_ID]=1;
   g_com_map[ANC_POLL]=1;
#endif
      dev_id = g_com_map[DEV_ID];
      g_com_map[VERSION] = 0x010a;
   temp=(float)g_com_map[MAX_REPORT_ANC_NUM]*4/3;   
   temp2=g_com_map[DEV_ID]*g_com_map[MAX_REPORT_ANC_NUM]*4/3;
   if(temp2<temp)
   {
      temp2++;
   }
   tyncpoll_time=g_com_map[DEV_ID]*(temp2);
      tyncpoll_time=g_com_map[DEV_ID]*(temp2);
   if(g_com_map[DEV_ROLE])
   {
   printf("鏍囩ID: %d .\r\n",dev_id);