zhyinch
2021-05-14 a0594f2bbdf3efc781afa09e139e7b49ec253187
源码/核心板/Src/main.c
@@ -63,10 +63,10 @@
      {module_power=MAX_RFPOWER;}
      if(module_power<0)
      {module_power=0;}
      if(g_com_map[MAX_REPORT_ANC_NUM]>10)
      {g_com_map[MAX_REPORT_ANC_NUM]=10;}
      if(g_com_map[MAX_REPORT_ANC_NUM]<1)
      {g_com_map[MAX_REPORT_ANC_NUM]=1;}
//      if(g_com_map[MAX_REPORT_ANC_NUM]>10)
//      {g_com_map[MAX_REPORT_ANC_NUM]=10;}
//      if(g_com_map[MAX_REPORT_ANC_NUM]<1)
//      {g_com_map[MAX_REPORT_ANC_NUM]=1;}
      if(g_com_map[IMU_THRES]>10)
      {g_com_map[IMU_THRES]=10;}
      if(g_com_map[IMU_THRES]<1)
@@ -94,7 +94,7 @@
#endif
   OUT485_ENABLE;
   ComMapCheck();
   g_com_map[VERSION] = 0x0212;
   g_com_map[VERSION] = 0x0217;
   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;
@@ -143,13 +143,15 @@
void HeatBeat(void)
{ u16 checksum;
    GetPressAndHeight();
    intheight = Height*100+g_com_map[MAX_REPORT_ANC_NUM];
    intheight = Height*100;//+g_com_map[MAX_REPORT_ANC_NUM];
   if(synclost_count>5)
   {
      hbsend[6] = 0;
   }else{
      hbsend[6] = 1;
   }
    if(intheight!=0)
        intheight+=(int16_t)g_com_map[MAX_REPORT_ANC_NUM];
   memcpy(&hbsend[7],&intheight,4); 
checksum = Checksum_u16(&hbsend[2],12);
memcpy(&hbsend[14],&checksum,2);