zhyinch
2021-03-17 a6d3ecc9ed8f7860a44f7ea0382acc3469ea3bd6
源码/核心板/Src/main.c
@@ -14,7 +14,6 @@
#include "deca_device_api.h"
#include "Flash.h"
//#define DEBUG_MODE
void Device_Init(void)
{
   RCC_Configuration();
@@ -80,9 +79,9 @@
      group_id=g_com_map[GROUP_ID];
      vel_factor=g_com_map[FILTER_COEFFICIENT];
      pos_factor=g_com_map[FILTER_COEFFICIENT];
      dist_threshold = g_com_map[SPEEDFILTER_THRES]/(1000/g_com_map[COM_INTERVAL]);
      if(dist_threshold<30)
      {dist_threshold = 30;}
      dist_threshold = (g_com_map[SPEEDFILTER_THRES]*10)/(1000/g_com_map[COM_INTERVAL]);
      if(dist_threshold<300)
      {dist_threshold = 300;}
      if(dist_threshold>15000)
      {dist_threshold = 15000;}
      if(dev_id==0)
@@ -92,7 +91,8 @@
      {
         module_power=67;
      }
      g_com_map[VERSION] = 0x0123;
      g_com_map[VERSION] = 0x012b;
        g_com_map[SW_TYPE] =    SW_MODBUS;
   temp=(float)g_com_map[MAX_REPORT_ANC_NUM]*4/3;   
   temp2=g_com_map[MAX_REPORT_ANC_NUM]*4/3;
   if(temp2<temp)
@@ -203,6 +203,11 @@
   Modbus_RegMap();
   while(1)
   {
    if(g_com_map[0] != 0x55AA)
   {
        while(1)
        IdleTask();
    }
   if(g_start_send_flag)
   {
      g_start_send_flag = 0;