redaiyuyuyu 2 сар өмнө
parent
commit
cedc8307d3

+ 1 - 1
.vscode/c_cpp_properties.json

@@ -12,7 +12,7 @@
             "cStandard": "c11",
             "cppStandard": "c++17",
             "intelliSenseMode": "gcc-x64",
-            "compilerPath": "D:/arm-gcc/bin/arm-none-eabi-gcc.exe"
+            "compilerPath": "D:/zhou/vscodestm32/gcc-arm-none-eabi-10.3-2021.10-win32/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gcc.exe"
         }
     ],
     "version": 4

+ 6 - 6
Inc/soft_obstacle.h

@@ -68,12 +68,12 @@ typedef struct
     short DM4DF_Blind_spot_distance;//4D前雷达盲区距离
     short DM4DB_Blind_spot_distance;//4D后雷达盲区距离
 
-    bool get_angel_4DF;//获取角度成功
-    bool get_ground_filter_4DF;//距离滤波成功
-    bool get_angel_4DB;//获取角度成功
-    bool get_ground_filter_4DB;//距离滤波成功
-    bool get_dotcloud_switch_4DF;//点云成功
-    bool get_dotcloud_switch_4DB;//点云成功
+    bool get_angel_4DF;//获取角度成功
+    bool get_ground_filter_4DF;//距离滤波成功
+    bool get_angel_4DB;//获取角度成功
+    bool get_ground_filter_4DB;//距离滤波成功
+    bool get_dotcloud_switch_4DF;//点云成功
+    bool get_dotcloud_switch_4DB;//点云成功
     bool get_DM4DF_Blind_spot_distance;//4D前避障盲区距离
     bool get_DM4DB_Blind_spot_distance;//4D后雷达盲区距离
 }_dev_par;

+ 2 - 0
Inc/soft_p_2_c.h

@@ -46,6 +46,8 @@ enum vklink_msgid
 	_MSGID_DMRADAR = 31,     //电目雷达测试
 	_MSGID_F4DRADAR = 32,     //电目4d前避障雷达测试
 	_MSGID_B4DRADAR = 33,     //电目4d后避障雷达测试
+	_MSGID_FT4DRADAR = 34,     //电目4D前避障分段高度
+	_MSGID_BT4DRADAR = 35,     //电目4D后避障分段高度
 	_MSGID_UPDATA = 200,   // 升级信息
 	_MSGID_CANDEBUG = 213, // CAN调试
 };

+ 31 - 1
Inc/soft_terrain.h

@@ -124,9 +124,36 @@ typedef struct
   uint8_t RawData[150 * 5];
 }DM_4dFRADAR;
 #pragma pack()
+
+#pragma pack(1)
+typedef struct 
+{
+  uint8_t target_num;
+  uint16_t time_delay;
+  uint16_t crc;
+  uint16_t err_num;
+  union dm_byte byte7;
+
+  uint8_t RawData[25 * 2];
+}DM_4dTRADAR;
+#pragma pack()
+extern DM_4dTRADAR DM_T4d;
+extern DM_4dTRADAR DM_BT4d;
+#pragma pack(1)
+typedef struct 
+{
+  uint8_t target_num;
+  uint16_t time_delay;
+  uint16_t err_num;
+
+  uint8_t RawData[25 * 2];
+}DM_4dTRADAR_tofmu;
+#pragma pack()
+extern DM_4dTRADAR_tofmu D4T_tofmu;
+extern bool F4T_send_flag;
 extern DM_4dFRADAR DM_F4d;
 extern DM_4dFRADAR DM_B4d;
-
+extern DM_4dTRADAR_tofmu D4BT_tofmu;
 extern Connect_check DM_status;
 extern Connect_check DM_4dstatus;
 extern DM_RADAR DM_T_info,FMU_DM_info;
@@ -134,6 +161,9 @@ extern uint8_t DM_recv_flag;
 extern uint8_t DM4d_recv_flag;
 extern uint8_t DM4d_to_fmu_flag;
 extern uint8_t DM4dB_recv_flag; 
+extern uint8_t DM4dt_recv_flag;
+extern uint8_t DM4dbt_recv_flag;
+extern bool F4DB_send_flag;
 void DM_terrain_recieved_hookfuction(uint32_t cellCanID,uint8_t data[], uint8_t len);
 void DM_Fobs_recieved_hookfuction(uint32_t cellCanID,uint8_t data[], uint8_t len);
 void DM_Bobs_recieved_hookfuction(uint32_t cellCanID,uint8_t data[], uint8_t len);

+ 8 - 3
Src/rkfifo.c

@@ -143,11 +143,13 @@ unsigned int rkfifo_in(rkfifo_t *fifo, const void *buf, unsigned int len)
     unsigned int l;
 
     l = kfifo_unused(fifo);
-    
+    //static char tempbuf[128];
+    //memcpy(tempbuf, buf, 128);
     if (len > l)
     {
-        len = l;
+        //len = l;
         fifo->error++;
+        return 0;
     }
 
     __rkfifo_copy_in(fifo, buf, len, fifo->in);
@@ -183,8 +185,11 @@ unsigned int rkfifo_out_peek(rkfifo_t *fifo, void *buf, unsigned int len)
 
     l = fifo->in - fifo->out;
     if (len > l)
+    {
         len = l;
-
+        //static uint32_t Times = 0;
+        //Times++;
+    }
     __rkfifo_copy_out(fifo, buf, len, fifo->out);
     return len;
 }

+ 18 - 17
Src/soft_engine.c

@@ -325,23 +325,24 @@ void Geely_version2_send_info( void )
 {
     uint8_t can_buf[8] = {0};
     //发送北京时间
-    // if(geely_send_BJtime == false && (beijing_time.ui8Year != 0)) //上点发送,CANID不在过滤器中 不等反馈
-    // {   
-    //     geely_sendinfo2.time += beijing_time.ui8Second / 2;
-    //     geely_sendinfo2.time += beijing_time.ui8Minute *( 0x1 << 4);
-    //     geely_sendinfo2.time += beijing_time.ui8Hour *( 0x1 << 10);
-    //     geely_sendinfo2.time += beijing_time.ui8DayOfMonth *( 0x1 << 15);
-    //     geely_sendinfo2.time += beijing_time.ui8Month *( 0x1 << 20);
-    //     geely_sendinfo2.time += beijing_time.ui8Year *( 0x1 << 24);
-
-    //     geely_sendinfo2.nodecode = 0;
-    //     geely_sendinfo2.check_sum0 = geely_sendinfo2.time + geely_sendinfo2.nodecode + (geely_sendinfo2.message_conut0 << 4);
-    //     geely_sendinfo2.check_sum0 = 0 - geely_sendinfo2.check_sum0;
-    //     memcpy(&can_buf[0],&geely_sendinfo2,6);
-    //     geely_sendinfo2.message_conut0++;
-
-    //     can_send_msg_normalstd(&can_buf[0],6,0x030);
-    // }
+    if(geely_send_BJtime == false && (beijing_time.ui8Year != 0)) //上点发送,CANID不在过滤器中 不等反馈
+    {   
+        geely_sendinfo2.time = 0;
+        geely_sendinfo2.time += beijing_time.ui8Second / 2;
+        geely_sendinfo2.time += beijing_time.ui8Minute *( 0x1 << 5);
+        geely_sendinfo2.time += beijing_time.ui8Hour *( 0x1 << 11);
+        geely_sendinfo2.time += beijing_time.ui8DayOfMonth *( 0x1 << 16);
+        geely_sendinfo2.time += beijing_time.ui8Month *( 0x1 << 21);
+        geely_sendinfo2.time += (beijing_time.ui8Year - 2000) *( 0x1 << 25);
+
+        geely_sendinfo2.nodecode = 0;
+        geely_sendinfo2.check_sum0 = geely_sendinfo2.time + geely_sendinfo2.nodecode + (geely_sendinfo2.message_conut0 << 4);
+        geely_sendinfo2.check_sum0 = 0 - geely_sendinfo2.check_sum0;
+        memcpy(&can_buf[0],&geely_sendinfo2,6);
+        geely_sendinfo2.message_conut0++;
+
+         can_send_msg_normalstd(&can_buf[0],6,0x030);
+     }
     //上电读取信息
     if(geely_get_version == false || geely_get_time == false)
     {

+ 2 - 1
Src/soft_obstacle.c

@@ -1102,7 +1102,8 @@ void can_send_info_to_mimo()
     static int mimo_50HZ = 0;
     static int mimo_49HZ = 0;
     if (mimo_f_info.Link.connect_status == COMP_NORMAL || mimo_b_info.Link.connect_status == COMP_NORMAL /*|| 
-        mimo_360_info.connect_status == COMP_NORMAL*/ || (Dev.Part_Fradar_Link.connect_status == COMP_NORMAL && Dev.Part_radarF.facid == FAC_MIMO_RF))
+        mimo_360_info.connect_status == COMP_NORMAL*/ || (Dev.Part_Fradar_Link.connect_status == COMP_NORMAL && Dev.Part_radarF.facid == FAC_MIMO_RF) || 
+        (uavr12_info.Link.connect_status == COMP_NORMAL || uavr11_info.Link.connect_status == COMP_NORMAL))
     {
         int16_t index = 0;
         short tmpShort = 0;

+ 104 - 8
Src/soft_p_2_c.c

@@ -106,8 +106,14 @@ void pmu_to_con_voltage_data()
     msg_buf[index++] = 0x00;
     msg_buf[index++] = 0x00;
     msg_buf[index++] = _MSGID_VOL;
-
-    pmu.voltage = ADC_gather() / 10.0f + volinf.cal_vol * 10; // 获取当前板子电压
+    if(Dev.Current_Link.connect_status == COMP_NORMAL)
+    {
+        pmu.voltage = (power_BatteryInfo.voltage * 100) + volinf.cal_vol * 10;
+    }
+    else
+    {
+        pmu.voltage = ADC_gather() / 10.0f + volinf.cal_vol * 10; // 获取当前板子电压
+    }
     memcpy(&msg_buf[index], &pmu.voltage, 2);
     index += 2;
 
@@ -656,6 +662,59 @@ void pmu_to_con_DM4DFradar_data(void)
     DM4d_recv_flag = 0;
     
 }
+//4D仿地雷达分段高度
+void pmu_to_con_DM4DTradar_data(void)
+{
+    uint8_t index = 0;
+    msg_buf[index++] = 0xFE;
+    msg_buf[index++] = 0;
+    msg_buf[index++] = 0;
+    msg_buf[index++] = 0x00;
+    msg_buf[index++] = 0x00;
+    msg_buf[index++] = _MSGID_FT4DRADAR;
+    DM4dt_recv_flag = 1;
+    memcpy(&msg_buf[index], &D4T_tofmu.target_num, 1);
+    index += 1;
+    memcpy(&msg_buf[index], &D4T_tofmu.time_delay, 2);
+    index += 2;
+    memcpy(&msg_buf[index], &D4T_tofmu.err_num, 2);
+    index += 2;
+    memcpy(&msg_buf[index], &D4T_tofmu.RawData, D4T_tofmu.target_num * 2);
+    index += D4T_tofmu.target_num * 2;
+    msg_buf[1] = index - 6;
+    crc = Get_Crc16(msg_buf, index);
+    msg_buf[index++] = crc;
+    msg_buf[index++] = (crc >> 8) & 0xff;
+
+    uart2_send_msg(msg_buf, index);
+    DM4dt_recv_flag = 0;
+}
+void pmu_to_con_DM4DBTradar_data(void)
+{
+    uint8_t index = 0;
+    msg_buf[index++] = 0xFE;
+    msg_buf[index++] = 0;
+    msg_buf[index++] = 0;
+    msg_buf[index++] = 0x00;
+    msg_buf[index++] = 0x00;
+    msg_buf[index++] = _MSGID_BT4DRADAR;
+    DM4dbt_recv_flag = 1;
+    memcpy(&msg_buf[index], &D4BT_tofmu.target_num, 1);
+    index += 1;
+    memcpy(&msg_buf[index], &D4BT_tofmu.time_delay, 2);
+    index += 2;
+    memcpy(&msg_buf[index], &D4BT_tofmu.err_num, 2);
+    index += 2;
+    memcpy(&msg_buf[index], &D4BT_tofmu.RawData, D4BT_tofmu.target_num * 2);
+    index += D4BT_tofmu.target_num * 2;
+    msg_buf[1] = index - 6;
+    crc = Get_Crc16(msg_buf, index);
+    msg_buf[index++] = crc;
+    msg_buf[index++] = (crc >> 8) & 0xff;
+
+    uart2_send_msg(msg_buf, index);
+    DM4dbt_recv_flag = 0;
+}
 //电目4D后避障雷达
 void pmu_to_con_DM4DBradar_data(void)
 {
@@ -728,8 +787,8 @@ void pmu_to_con_DM4DBradar_msg(void)
     msg_buf[index++] = 'K';
     msg_buf[index++] = 'Z';
     msg_buf[index++] = '1';
-    memcpy(&msg_buf[index],&DM_4DRADARMAG.angel_4DF,16);
-    index += 16;
+    memcpy(&msg_buf[index],&DM_4DRADARMAG.angel_4DF,(sizeof(_dev_par) - 8));
+    index += (sizeof(_dev_par)-8);
     msg_buf[1] = index - 6;
     crc = Get_Crc16(msg_buf, index);
     msg_buf[index++] = crc;
@@ -776,6 +835,7 @@ void pmu_to_con_heart_data()
     crc = Get_Crc16(msg_buf, index);
     memcpy(&msg_buf[index], &crc, 2);
     index += 2;
+    //static uint32_t send_times = 0;
     uart2_send_msg(msg_buf, index);
 }
 
@@ -1341,12 +1401,23 @@ void pmu_to_fcu()
             pmu_to_con_heart_data();
             pmu_heart_flag = false;
         }
-        if(F4d_send_flag == true)
+        if (F4T_send_flag == true)
+        {
+            pmu_to_con_DM4DTradar_data();
+            F4T_send_flag = false;
+        }
+        if(F4DB_send_flag == true)
+        {   
+            pmu_to_con_DM4DBTradar_data();
+            F4DB_send_flag = false;
+        }
+        /*if(F4d_send_flag == true)
         {
             pmu_to_con_DM4DFradar_data();
             F4d_send_flag = false;
-        }
-        if(DM4Dmsg_send_fmu == true || (pmu_to_DM4Dmsg_flag == true && DM4d_to_fmu10s_flag <= 10000))
+        }*/
+        if(DM4Dmsg_send_fmu == true || ((pmu_to_DM4Dmsg_flag == true && DM4d_to_fmu10s_flag <= 10000) && 
+           (Dev.Part_Fradar_Link.connect_status == COMP_NORMAL || Dev.Part_Bradar_Link.connect_status == COMP_NORMAL)))
         {
             pmu_to_con_DM4DBradar_msg();
             DM4d_to_fmu10s_flag = HAL_GetTick();
@@ -1518,6 +1589,7 @@ void uart_recv_con_msg()
             if(uavinf.uavtype != planep.UAV_type)
             {
                 write_uav_information = true;
+
             }
             break;
         case _MSGID_TIME:
@@ -1551,6 +1623,9 @@ void uart_recv_con_msg()
             case MSGID_ACK_HEART:
                 uavinf.abnormal_outage_flag = 0;
                 write_uav_information = true;
+
+
+
                 break;
             case MSGID_ACK_VERSION:
                 start_msg.version_info = true;
@@ -1722,7 +1797,22 @@ void uart_recv_con_msg()
                 }
                 break;
             case MSGID_SET_VOL:
-                set_cali_voltage = (fcu_protocol.payload[7] + 256 * fcu_protocol.payload[8]) - (int)(ADC_gather() /100.0f) ;
+                if(Dev.Current_Link.connect_status == COMP_NORMAL)
+                {
+                    /*static short tem_16t = 0 ;
+                    tem_16t = fcu_protocol.payload[7] + 256 * fcu_protocol.payload[8];
+                    static short tem2_16t = 0 ;
+                    tem2_16t = power_BatteryInfo.voltage * 10;*/
+                    set_cali_voltage = (fcu_protocol.payload[7] + 256 * fcu_protocol.payload[8]) - (power_BatteryInfo.voltage * 10) ;
+                }
+                else
+                {
+									  /*static short tem3_16t = 0 ;
+                    tem3_16t = fcu_protocol.payload[7] + 256 * fcu_protocol.payload[8];
+                    static short tem4_16t = 0 ;
+                    tem4_16t = (int)(ADC_gather() /100.0f);*/
+                    set_cali_voltage = (fcu_protocol.payload[7] + 256 * fcu_protocol.payload[8]) - (int)(ADC_gather() /100.0f) ;
+                }
                 write_vol_information = true;
                 pmu_set_ack(_MSGID_SET,MSGID_SET_VOL,0,0);
                 break;
@@ -1853,6 +1943,12 @@ void uart_recv_con_msg()
                 else if(set_pmu_serail == serial.num)
                 {
                     pmu_set_ack(_MSGID_SET,MSGID_SET_PMU_SERIAL,0,0);
+
+
+
+
+                    
+
                 }             
                 break;
             case MSGID_SET_RADAR_FB:

+ 3 - 2
Src/soft_seed_device.c

@@ -13,7 +13,8 @@
 #include "soft_version.h"
 #include "math.h"
 #include "qingxie_bms.h"
-
+#include "soft_adc.h"
+#include "soft_flash.h"
 weight weight_vkinfo;
 seed seed_vkinfo;
 send_seed_device seed_dev;
@@ -1162,7 +1163,7 @@ void  update_device_type_data(void)
            Dev.Current.facid = FAC_VK;
 
             Dev.Current.tempture = power_BatteryInfo.temperature * 10;
-            Dev.Current.voltage = power_BatteryInfo.voltage * 10;
+            Dev.Current.voltage = (power_BatteryInfo.voltage * 10) + volinf.cal_vol;
             Dev.Current.current = power_BatteryInfo.current * 10;
         }
 

+ 98 - 5
Src/soft_terrain.c

@@ -222,6 +222,11 @@ int dm_4df_i = 0;
 DM_4DRADAR FMU_4D_info;
 bool F4d_send_flag = false;
 bool DM4Dmsg_send_fmu=false;
+DM_4dTRADAR DM_T4d;
+int dm_4dt_i = 0;
+DM_4dTRADAR_tofmu D4T_tofmu;
+bool F4T_send_flag = false;
+uint8_t DM4dt_recv_flag = 0;
 void DM_Fobs_recieved_hookfuction(uint32_t cellCanID, uint8_t data[], uint8_t len)
 {
     if (cellCanID == 0XA01300) // 多点协议
@@ -279,7 +284,7 @@ void DM_Fobs_recieved_hookfuction(uint32_t cellCanID, uint8_t data[], uint8_t le
     }
 
     // 4D前避障雷达协议 点云
-    if (cellCanID == 0XA01310)
+    /*if (cellCanID == 0XA01310)
     {
         DM_4dstatus.connect_status = COMP_NORMAL;
         DM_4dstatus.recv_time = HAL_GetTick();
@@ -330,7 +335,7 @@ void DM_Fobs_recieved_hookfuction(uint32_t cellCanID, uint8_t data[], uint8_t le
         {
             dm_4df_i = 0;
         }
-    }
+    }*/
     // 4D前避障雷达协议 单点
     if (cellCanID == 0XA01302)
     {
@@ -354,7 +359,48 @@ void DM_Fobs_recieved_hookfuction(uint32_t cellCanID, uint8_t data[], uint8_t le
         F_4DRadar[2][1] = data[3] + data[4] * 256;
         F_4DRadar[2][2] = data[5] + data[6] * 256;
     }
-
+else if(cellCanID == 0XA01305)
+    {
+        DM_T4d.byte7.frame_flag = data[7];
+        if(DM_T4d.byte7.flag.head != 0 && data[0] == 25)
+            {
+                memcpy(&DM_T4d.target_num, &data[0], 7);
+                dm_4dt_i = 0;
+            }
+        else if(DM_T4d.byte7.flag.tail != 0)
+        {
+             if(data[0] == 0xFE)
+             {
+                memcpy(&DM_T4d.RawData[dm_4dt_i], &data[1], 2);
+                dm_4dt_i += 2;
+             }
+             if(DM_T4d.crc == Get_Crc16(&DM_T4d.RawData[0], DM_T4d.target_num * 2) && DM4dt_recv_flag == 0)
+             {
+                   D4T_tofmu.target_num = DM_T4d.target_num;
+                   D4T_tofmu.time_delay = DM_T4d.time_delay;
+                   D4T_tofmu.err_num = DM_T4d.err_num;
+                   memcpy(&D4T_tofmu.RawData, &DM_T4d.RawData, DM_T4d.target_num * 2);
+                   F4T_send_flag = true;
+             }
+             else
+             {
+                static uint32_t tmpnum = 0;
+                tmpnum++;
+             }
+        }
+        else
+        {
+            if(data[0] == 0xFE)
+            {
+                memcpy(&DM_T4d.RawData[dm_4dt_i], &data[1], 6);
+                dm_4dt_i += 6;
+            }
+        }
+        if (dm_4dt_i >= 25 * 2)
+        {
+            dm_4dt_i = 0;
+        }
+    }
     // 版本信息
     if (cellCanID == 0XA81301 && data[0] == 0x1)
     {
@@ -472,10 +518,15 @@ DM_4dFRADAR DM_B4d;
 int dm_4dB_i = 0;
 // DM_4DRADAR FMU_4DB_info;
 uint8_t DM4dB_recv_flag = 0;
+DM_4dTRADAR DM_BT4d;
+int dm_4dbt_i = 0;
+DM_4dTRADAR_tofmu D4BT_tofmu;
+uint8_t DM4dbt_recv_flag;
+bool F4DB_send_flag;
 void DM_Bobs_recieved_hookfuction(uint32_t cellCanID, uint8_t data[], uint8_t len)
 {
     // 4D后避障雷达协议 点云
-    if (cellCanID == 0XB01310)
+    /*if (cellCanID == 0XB01310)
     {
         // DM_4dstatus.connect_status = COMP_NORMAL;
         // DM_4dstatus.recv_time = HAL_GetTick();
@@ -527,7 +578,7 @@ void DM_Bobs_recieved_hookfuction(uint32_t cellCanID, uint8_t data[], uint8_t le
         {
             dm_4dB_i = 0;
         }
-    }
+    }*/
     // 4D后避障雷达协议 单点
     if (cellCanID == 0XB01302)
     {
@@ -551,6 +602,48 @@ void DM_Bobs_recieved_hookfuction(uint32_t cellCanID, uint8_t data[], uint8_t le
         B_4DRadar[2][1] = data[3] + data[4] * 256;
         B_4DRadar[2][2] = data[5] + data[6] * 256;
     }
+    else if(cellCanID == 0XB01305)
+    {
+        DM_BT4d.byte7.frame_flag = data[7];
+        if(DM_BT4d.byte7.flag.head != 0 && data[0] == 25)
+            {
+                memcpy(&DM_BT4d.target_num, &data[0], 7);
+                dm_4dbt_i = 0;
+            }
+        else if(DM_BT4d.byte7.flag.tail != 0)
+        {
+             if(data[0] == 0xFE)
+             {
+                memcpy(&DM_BT4d.RawData[dm_4dbt_i], &data[1], 2);
+                dm_4dbt_i += 2;
+             }
+             if(DM_BT4d.crc == Get_Crc16(&DM_BT4d.RawData[0], DM_BT4d.target_num * 2) && DM4dbt_recv_flag == 0)
+             {
+                   D4BT_tofmu.target_num = DM_BT4d.target_num;
+                   D4BT_tofmu.time_delay = DM_BT4d.time_delay;
+                   D4BT_tofmu.err_num = DM_BT4d.err_num;
+                   memcpy(&D4BT_tofmu.RawData, &DM_BT4d.RawData, DM_BT4d.target_num * 2);
+                   F4DB_send_flag = true;
+             }
+             else
+             {
+                static uint32_t tmpnum = 0;
+                tmpnum++;
+             }
+        }
+        else
+        {
+            if(data[0] == 0xFE)
+            {
+                memcpy(&DM_BT4d.RawData[dm_4dbt_i], &data[1], 6);
+                dm_4dbt_i += 6;
+            }
+        }
+        if (dm_4dbt_i >= 25 * 2)
+        {
+            dm_4dbt_i = 0;
+        }
+    }
     else if (cellCanID == 0xB81302 && (data[0] == 0x1 || data[0] == 0x2))
     {
         uint32_t version_temp = 0;

+ 2 - 1
Src/soft_test.c

@@ -184,7 +184,8 @@ void pmu_inside_led()
  **/
 uint8_t recv_vk_protocol[MAX_UART_BUF] = {0};
 uint8_t candebug_protocol[MAX_UART_BUF] = {0};
-uint8_t send_uart_buffer[ MAX_UART_BUF * 8 ] = {0};
+//uint8_t send_uart_buffer[ MAX_UART_BUF * 4 ] = {0};
+uint8_t send_uart_buffer[ MAX_UART_BUF * 4] = {0};
 void user_init(void)
 {
   //can pwm uart 初始化

+ 1 - 2
Src/soft_uart.c

@@ -130,8 +130,7 @@ void uart2_send_msg(uint8_t *data, uint8_t size)
 	// uart2_send_delay_time = HAL_GetTick();
 	//bspSerialWrite(&serial2,data,size);
 }
-uint8_t send_uart_buf[256] = {0};
-
+uint8_t send_uart_buf[256 * 4] = {0};
 void send_uartfifo_msg(void)
 {
 	uint16_t len = 0;

+ 2 - 2
Src/soft_water_device.c

@@ -6,7 +6,7 @@
 #include "soft_seed_device.h"
 #include "soft_crc.h"
 #include "soft_version.h"
-
+#include "soft_flash.h"
 /**
   * @file    liquid_recieved_hookfuction
   * @brief   液位计解析
@@ -569,7 +569,7 @@ void uavcan_equipment_power_BatteryInfo_decode(uint8_t *recv_buf, uint32_t len,
         BufIndex = 0;
         BufGetS = false;
     }
-
+    //电流计
     if ( BufGetS == true && revTail.HWTailBit.end == 1 )
     {
         uint16_t sigcrc = crcAddSignature( HW_CRC_INITVALUE, UAVCAN_EQUIPMENT_POWER_BATTERYINFO_SIGNATURE );