zhyinch
2020-11-18 be27b2e2729c0255d70a60ba5d07b258b7c41e78
源码/核心板/Src/main.c
@@ -52,6 +52,7 @@
uint16_t vel_factor,pos_factor;
extern u8 module_power;
u16 slottime,max_slotnum,current_slotpos;
void Program_Init(void)
{uint16_t i;
   float temp;
@@ -86,14 +87,17 @@
      {
         module_power=67;
      }
      g_com_map[VERSION] = 0x0115;
      g_com_map[VERSION] = 0x0121;
   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;
   temp2=g_com_map[MAX_REPORT_ANC_NUM]*4/3;
   if(temp2<temp)
   {
      temp2++;
   }
      tyncpoll_time=g_com_map[DEV_ID]*(temp2);
   slottime=temp2;
   max_slotnum=g_com_map[COM_INTERVAL]/temp2;
   current_slotpos=g_com_map[DEV_ID];
   tyncpoll_time=(current_slotpos%max_slotnum)*slottime;
   if(g_com_map[DEV_ROLE])
   {
   printf("鏍囩ID: %d .\r\n",dev_id);
@@ -198,7 +202,7 @@
   {
      g_start_send_flag = 0;   
      temp=dwt_readtempvbat(1);
      dw_vbat=(float)(temp&0xff-173)/173+3.3;
      dw_vbat=(float)((temp&0xff)-173)/173+3.3;
      if(dw_vbat>2.8)      
      Tag_App();
   }//else{