فهرست منبع

1、版本发布

z8359531l 3 ماه پیش
والد
کامیت
7e09ea5fb5

+ 1 - 3
.vscode/c_cpp_properties.json

@@ -12,9 +12,7 @@
             "cStandard": "c11",
             "cppStandard": "c++17",
             "intelliSenseMode": "gcc-x64",
-            //"compilerPath": "D:\\arm-gcc\\bin\\arm-none-eabi-gcc.exe"
-            //"compilerPath":"D:/arm-gcc/new/arm-gcc/bin/arm-none-eabi-gcc.exe",
-
+            "compilerPath": "D:/arm-gcc/bin/arm-none-eabi-gcc.exe"
         }
     ],
     "version": 4

+ 42 - 0
Inc/soft_eft.h

@@ -10,6 +10,13 @@
 #define REVE_EFT_LOW    0x88F1
 #define BMS_LINE_TEMP   0x88AA
 
+#define LPump1 (uint32_t)0x8810
+#define LPump2 (uint32_t)0x8821
+
+//Z70吊运称重
+#define CAN_EFT70_WEIGHT (0x88BA)
+#define CAN_EFT70_WEIGHT_ACK (0x88BC)
+
 #define Cal_Remove_Peel     20
 #define Cal_Weight          21
 #define Cal_Seed_Back       23
@@ -18,7 +25,28 @@
 #define Cal_Set_Sensor_Mode 26
 #define Cal_Set_Doserate    27
 
+#pragma pack(1)
+typedef struct 
+{
+    uint8_t reserve;
+    uint16_t k1:14;
+    uint16_t k2:14;
+    uint16_t k3:14;
+    uint16_t k4:14;
+}z70_weight;
+#pragma pack()
 
+typedef union 
+{
+    uint8_t buf[8];
+    z70_weight info;
+}weight70_dev;
+extern weight70_dev z70weight;
+
+extern bool eft_sparyDev_priority;
+extern bool eft_weightDev_priority;
+extern bool weight_runing_time;
+extern uint16_t LiftingWeight_warning;
 void EftCanRecvHookFunction(uint32_t cellCanID, uint8_t data[], uint8_t len);
 void can_sendmsg_eft(void);
 void DMlacklossCanRecvFunction(uint32_t cellCanID, uint8_t data[], uint8_t len);
@@ -80,4 +108,18 @@ extern short tppwm_value;
 extern short sow_rotate_value;
 extern uint8_t seed_output_mode;
 
+#pragma pack(1)
+typedef struct 
+{
+    uint8_t error_status;
+    uint8_t control_mode;//pwm can
+    uint16_t can_baudrate;
+    short rpm;
+    uint8_t reserve;
+    uint8_t life;
+}water_dev;
+#pragma pack()
+extern water_dev Lpump1;
+extern water_dev Lpump2;
+
 #endif

+ 9 - 1
Inc/soft_engine.h

@@ -5,7 +5,15 @@
 #include "stdio.h"
 #include "common.h"
 
-
+typedef enum
+{
+    ENGINE_DEFAULT = 0,
+    ENGINE_RUISHEN = 1,
+    ENGINE_AOAN = 2,
+    ENGINE_VK = 3,
+    ENGINE_GEELY = 4,
+    ENGINE_BRO = 5,
+}FAC_TYPE;
 
 
 //===============奥安老发动机===============

+ 3 - 8
Inc/soft_p_2_c.h

@@ -176,14 +176,8 @@ typedef struct
 	short UAV_type;
 	short thr_pwm;
 	short Candebug_flag; // can调试 0开 1关
-	float QuaterQ0;
-	float QuaterQ1;
-	float QuaterQ2;
-	float QuaterQ3;
-	float pos_x;
-	float pos_y;
-	float pos_z;
-	int	pos_flag;
+	int pos_x;           //经度
+	int pos_y;			 //纬度
 } plane_para;
 #pragma pack()
 extern plane_para planep;
@@ -196,6 +190,7 @@ typedef struct soft_p_2_c
 	uint8_t num;
 	uint16_t content1;
 	uint16_t content2;
+	uint16_t content3;
 } Set_info;
 extern Set_info msgidset;
 

+ 3 - 0
Inc/soft_seed_device.h

@@ -78,12 +78,14 @@ enum FACID
 {
     FAC_VK = 0,        // 默认VK
     FAC_EFT = 1,       // EFT
+    FAC_LIFTWEIGHT = 2, //吊运称重
     FAC_QIFEI = 3,     // 启飞播撒
     FAC_VK_ALLINONE = 4,  //VK一体化
     FAC_MIMO_SIG = 5,  // 恩曌单管
     FAC_MIMO_DOU = 6,  // 恩曌双管
     FAC_QIFEI_SIG = 7, // 启飞单管流量计
     FAC_QIFEI_DOU = 8, // 启飞双管流量计
+    FAC_LPUMP = 9,     //线性水泵
 
     FAC_VK_BMS = 10,   // vk电池
     FAC_TATTU = 11,    // 格式电池
@@ -351,6 +353,7 @@ typedef struct
     uint8_t type;
     uint16_t order_con1;
     uint16_t order_con2;
+    uint16_t order_con3;
 } Weight_cal;
 #pragma pack(0)
 extern Weight_cal weight_order;

+ 2 - 0
Inc/soft_water_device.h

@@ -2,6 +2,8 @@
 #define  _SOFT_WATER_DEVICE_H_
 #include "common.h"
 
+
+
 #pragma pack(1)
 typedef struct{ 
     short liquid_percent;

+ 1 - 1
Src/main.c

@@ -159,7 +159,7 @@ int main(void)
     //更新播撒,称重,水泵,离心喷头,流量计等设备信息
     update_device_type_data(); 
 
-    DM_obs_test();//test 
+    //DM_obs_test();//test 
 //debug test
 #ifdef Debug_Mode
 

+ 118 - 8
Src/soft_eft.c

@@ -22,6 +22,13 @@ short sow_rotate_value = 1000;
 _Temp_sensor Temp_sensor;
 _mimo_lackloss mimo_lackloss;
 _mimo_lackloss DM_lackloss;
+water_dev Lpump1;
+water_dev Lpump2;
+weight70_dev z70weight;
+bool weight_runing_time = false;
+bool eft_sparyDev_priority = false;//EFT飞机存在两种水泵、称重ID一起发送
+bool eft_weightDev_priority = false;
+uint16_t LiftingWeight_warning = 0;
 void EftCanRecvHookFunction(uint32_t cellCanID, uint8_t data[], uint8_t len)
 {
     switch (cellCanID)
@@ -39,20 +46,29 @@ void EftCanRecvHookFunction(uint32_t cellCanID, uint8_t data[], uint8_t len)
         break;
     case REVE_EFT_INFO:
         eft_info.enginearm_lock = data[0];
-        eft_info.weight = data[1] * 256 + data[2];
+        
+        if(eft_weightDev_priority != true)
+        {
+            eft_info.weight = data[1] * 256 + data[2];
+            Dev.Weight_Link.connect_status = COMP_NORMAL;
+            Dev.Weight.facid = FAC_EFT;
+            Dev.Weight_Link.recv_time = HAL_GetTick();
+        }
+
         eft_info.pump1_rpm = data[4];
         eft_info.pump2_rpm = data[3];
         eft_info.cent1_rpm = data[5];
         eft_info.cent2_rpm = data[6];
         eft_info.watering_warn_status = data[7];
 
-        Dev.Weight_Link.connect_status = COMP_NORMAL;
-        Dev.Weight.facid = FAC_EFT;
-        Dev.Weight_Link.recv_time = HAL_GetTick();
+        
 
-        Dev.Pump_Link.connect_status = COMP_NORMAL;
-        Dev.Pump.facid = FAC_EFT;
-        Dev.Pump_Link.recv_time = HAL_GetTick();
+        if(eft_sparyDev_priority == false)
+        {
+            Dev.Pump_Link.connect_status = COMP_NORMAL;
+            Dev.Pump.facid = FAC_EFT;
+            Dev.Pump_Link.recv_time = HAL_GetTick();
+        }
 
         Dev.Nozzle_Link.connect_status = COMP_NORMAL;
         Dev.Nozzle.facid = FAC_EFT;
@@ -122,6 +138,100 @@ void EftCanRecvHookFunction(uint32_t cellCanID, uint8_t data[], uint8_t len)
         Dev.Temp_Sensor_Link.recv_time = HAL_GetTick();
         regist_dev_info(&dev_tempSensor,DEVICE_TEMP_SENSOR,false,NULL,0,NULL,0,NULL,0,"EFT",4);
         break;
+    case LPump1:
+        eft_sparyDev_priority = true;
+        memcpy(&Lpump1,&data[0],sizeof(water_dev));
+
+        Dev.L_pump1_Link.connect_status = COMP_NORMAL;
+        Dev.L_pump1.facid = FAC_EFT;
+        Dev.L_pump1_Link.recv_time = HAL_GetTick();
+        Dev.Flow.facid = FAC_LPUMP;
+        break;
+    case LPump2:
+        eft_sparyDev_priority = true;
+        memcpy(&Lpump2,&data[0],sizeof(water_dev));
+
+        Dev.L_pump2_Link.connect_status = COMP_NORMAL;
+        Dev.L_pump2.facid = FAC_EFT;
+        Dev.L_pump2_Link.recv_time = HAL_GetTick();
+        Dev.Flow.facid = FAC_LPUMP;
+        break;
+    case CAN_EFT70_WEIGHT:
+        eft_weightDev_priority = true;
+        eft_info.weight = (data[0] + data[1] * 256);
+        LiftingWeight_warning = data[2];
+
+        Dev.Weight_Link.connect_status = COMP_NORMAL;
+        Dev.Weight.facid = FAC_LIFTWEIGHT;
+        Dev.Weight_Link.recv_time = HAL_GetTick();
+        break;
+    case CAN_EFT70_WEIGHT_ACK:
+        //称重回馈
+        switch (data[0])
+        {
+        case 0xe1:
+            pmu_set_ack(_MSGID_SET,25,Cal_Remove_Peel,0); 
+            break;
+        case 0xe2:
+            pmu_set_ack(_MSGID_SET,25,Cal_Weight,0);
+            break;
+        case 0xe3:
+            pmu_set_ack(_MSGID_SET,MSGID_SET_WEIGHT_K,0,0);
+            break;
+        case 0xe4:
+            z70weight.info.k1 = data[1] + ((data[2] & 0x3f) << 8);
+            z70weight.info.k2 = (data[2] >> 6) + (data[3] << 2) + ((data[4] & 0xf) << 10);
+            z70weight.info.k3 = (data[4] >> 4) + (data[5] << 4)  + ((data[6] & 0x3) << 12);
+            z70weight.info.k4 = (data[6] >> 2) + (data[7] << 6);
+            break;
+        case 0XF3:
+            for(uint8_t i = 0;i < 3;i++)
+            {
+                dev_weight.sn[2 * i] = ((data[2+i] >> 4) & 0xf) + '0';
+                dev_weight.sn[2 * i + 1] = (data[2+i] & 0xf )+ '0';
+            }
+            dev_weight.sn[6] = ((data[7] >> 4) & 0xf) + '0';
+            dev_weight.sn[7] = (data[7] & 0xf )+ '0';
+
+            regist_dev_info(&dev_weight,DEVICE_WEIGHT,false,dev_weight.sn,8,NULL,0,NULL,0,"eftweight",10);
+            break;
+        case 0xF4:
+            for (uint8_t i = 2; i < 5; i++)
+            {
+                if(data[i] < 10)
+                {
+                    dev_weight.soft_serial[2 * (i - 2)] = '0';
+                    Int2String(data[i],&dev_weight.soft_serial[2 * (i - 2) + 1],1);
+                }
+                else
+                {
+                    Int2String(data[i],&dev_weight.soft_serial[ (i - 2) * 2],2);
+                }
+
+            }
+            if(data[7] < 10)
+            {
+                dev_weight.soft_serial[2 * (4 - 1)] = '0';
+                Int2String(data[7],&dev_weight.soft_serial[2 * (4 - 1) + 1],1);
+            }
+            else
+            {
+                Int2String(data[7],&dev_weight.soft_serial[ (4 - 1) * 2],2);
+            }
+
+            regist_dev_info(&dev_weight,DEVICE_WEIGHT,false,NULL,0,dev_weight.soft_serial,8,NULL,0,"eftweight",10);
+            break;
+        case 0xF5:
+            Dev.Weight.run_time = data[2] + (data[3] + data[4] * 256) * 60;
+            weight_runing_time = true;
+            break;
+        case 0xF7:
+            pmu_set_ack(_MSGID_SET,MSGID_SET_RESIWIRE_BLOWN,data[1],0);
+            break;
+        default:
+            break;
+        }
+        break;
     default:
         break;
     }
@@ -170,7 +280,7 @@ void can_sendmsg_eft(void)
             }
         }
     }
-    if((Dev.Weight_Link.connect_status == COMP_NORMAL && Dev.Weight.facid == FAC_EFT)) 
+    if(Dev.Weight_Link.connect_status == COMP_NORMAL && (Dev.Weight.facid == FAC_EFT || Dev.Weight.facid == FAC_LIFTWEIGHT)) 
     {   
         seed_init_send_info(WEIGHT_DEVICE,"EFT");
         Set_Seed_Weight_Par(WEIGHT_DEVICE,"EFT");

+ 35 - 6
Src/soft_engine.c

@@ -5,6 +5,7 @@
 #include "soft_p_2_c.h"
 #include "soft_test.h"
 #include "soft_uart.h"
+#include "math.h"
 
 struct ENGINE_DATA engine_data;
 
@@ -235,6 +236,7 @@ void EngGeelyCanRecvHookFunction(uint32_t cellCanID, uint8_t data[], uint8_t len
             geely_get_version = true;
             geely_count = 10;
             memcpy(&geely_data2.engine_ver,&data[0],8);
+
             break;
         case 0x1E3:
             geely_get_time = true;
@@ -406,7 +408,7 @@ STO_GEELY sendto_geely = {.ExtenderControl = 0,
                           .MessageCount = 0
                          };
 
-uint32_t sendto_geely_lasttime = 0;
+
 
 uint8_t vkv3_buf[20] = {0};
 void send_msg_to_vk3(void)
@@ -447,6 +449,31 @@ void send_msg_to_vk3(void)
 
 void send_msg_to_geely(void)
 {
+    static uint32_t sendto_geely_lasttime = 0;
+    static uint32_t sendto_bro_lasttime = 0;
+
+    if (geely_engin_link.connect_status == COMP_NORMAL && engine_data.engine_type == ENGINE_BRO && HAL_GetTick() - sendto_bro_lasttime > 222)
+    {
+        uint8_t can_buf[8] = {0};
+        short temp = 0;
+
+        sendto_bro_lasttime = HAL_GetTick();
+
+        memcpy(&can_buf[0],&planep.alt,2);
+
+        temp = sqrtf(planep.E_vel * planep.E_vel + planep.N_vel * planep.N_vel);
+        memcpy(&can_buf[2],&temp,2);
+
+        memcpy(&can_buf[4],&planep.yaw,2);
+        memcpy(&can_buf[6],&planep.lock_status,2);
+
+        can_send_msg_normalstd(&can_buf[0],8,0x1F0);
+
+        memcpy(&can_buf[0],&planep.pos_x,4);
+        memcpy(&can_buf[4],&planep.pos_y,4);
+        can_send_msg_normalstd(&can_buf[0],8,0x1F1);
+
+    }
     if (geely_engin_link.connect_status == COMP_NORMAL && HAL_GetTick() - sendto_geely_lasttime > 100)
     {
         uint8_t geely[8] = {0};
@@ -547,7 +574,6 @@ void send_msg_to_geely(void)
 
 comp_status engine_link_status = COMP_NOEXIST;
 
-struct ENGINE_DATA engine_data = {0, 0};
 /*
 发动机类型	    uint8		1-瑞深 2-中飞
 发动机转速	    uint16_t		RPM
@@ -590,7 +616,7 @@ void update_engine_data(void)
         engine_link_status = COMP_NORMAL;
 
         //数字显示,显示9位数
-        engine_data.engine_type = 2;
+        engine_data.engine_type = ENGINE_AOAN;
         engine_data.engine_rev = aoan_data.engin_rev;
         engine_data.engine_thr = aoan_data.engin_thr;
         engine_data.engine_vol = aoan_data.engin_vol;
@@ -611,7 +637,7 @@ void update_engine_data(void)
         engine_link_status = COMP_NORMAL;
 
         //数字显示,显示9位数
-        engine_data.engine_type = 3;
+        engine_data.engine_type = ENGINE_VK;
         engine_data.engine_rev = vkv3_data.engin_rev;
         engine_data.engine_thr = vkv3_data.engin_thr;
         engine_data.engine_vol = vkv3_data.engin_vol;
@@ -637,7 +663,7 @@ void update_engine_data(void)
     {
         engine_link_status = COMP_NORMAL;
 
-        engine_data.engine_type = 4;
+        engine_data.engine_type = ENGINE_GEELY;
 
         //数字显示,显示9位数
         if(geely_data2.version2_flag != true)
@@ -665,7 +691,10 @@ void update_engine_data(void)
         }
         else
         {
-            engine_data.engine_type = 4;
+            if(geely_data2.engine_brand[0] == 'B' && geely_data2.engine_brand[1] =='R' && geely_data2.engine_brand[2] =='O')
+            {   
+                engine_data.engine_type = ENGINE_BRO;
+            }
             engine_data.engine_rev = geely_data2.engine_rev;
             engine_data.engine_thr = geely_data2.Bit1EA.engine_ATP1 * 0.05f;
             engine_data.engine_vol = geely_data2.engine_vol * 0.1f;

+ 10 - 0
Src/soft_p_2_c.c

@@ -1212,6 +1212,7 @@ void check_fmu_link()
 _pmu_pin pmu_pin;
 bool recv_fmu_data = false;
 Set_info msgidset;
+uint32_t DMJZ=0;
 void uart_recv_con_msg()
 {
     check_fmu_link();
@@ -1354,6 +1355,7 @@ void uart_recv_con_msg()
             msgidset.num  = fcu_protocol.payload[6];
             msgidset.content1 = fcu_protocol.payload[7] + 256 * fcu_protocol.payload[8];
             msgidset.content2 = fcu_protocol.payload[9] + 256 * fcu_protocol.payload[10];
+            msgidset.content3 = fcu_protocol.payload[11] + 256 * fcu_protocol.payload[12];
             switch (msgidset.num)
             {
             //前雷达
@@ -1595,6 +1597,7 @@ void uart_recv_con_msg()
                 case Cal_Weight:
                     weight_order.type = Weight_Kg;
                     weight_order.order_con2 =  msgidset.content2;
+                    weight_order.order_con3 =  msgidset.content3;
                     break;
                 case Cal_Seed_Back:
                     weight_order.type = Weight_Bcak;
@@ -1672,6 +1675,13 @@ void uart_recv_con_msg()
                 setESCidInfo.setESCidStep = SETESCID_INIT;
                 pmu_set_ack(_MSGID_SET,MSGID_SET_PUMP_ID,0,2);
                 break;
+            case MSGID_SET_RESIWIRE_BLOWN:
+                {
+                uint8_t can_buf[8] = {0};
+                put_date_to_can(can_buf,0xF7,fcu_protocol.payload[7],0x00,0x00,0x00,0xF1,0XF3,0X00);
+                can_send_msg_normal(&can_buf[0], 8, 0x88BB);
+                }
+                break;
             case MSGID_SET_FRADAR_SN:
                 {
                     int radar_Sn = 0;

+ 130 - 71
Src/soft_seed_device.c

@@ -277,7 +277,7 @@ void seed_init_send_info(uint8_t device_type,char *factory)
         switch (device_type)
         {
         case WEIGHT_DEVICE:
-            if(weight_init_eft.status != 0)
+            if(weight_init_eft.status != 0 && eft_weightDev_priority == false)
             {
                 if(weight_init_eft.step.read_k_flag != 0)
                 {
@@ -285,18 +285,6 @@ void seed_init_send_info(uint8_t device_type,char *factory)
                     vk_canbuf[5] = 0xf1;
                     vk_canbuf[6] = 0xf3;
                 }
-                // else if(weight_init.step.sn_flag != 0) //EFT前板没有反馈。SN和版本
-                // {
-                //     vk_canbuf[0] = 0xF8;
-                //     vk_canbuf[5] = 0xf1;
-                //     vk_canbuf[6] = 0xf3;
-                // }
-                // else if(weight_init.step.version_flag != 0)
-                // {
-                //     vk_canbuf[0] = 0xf9;
-                //     vk_canbuf[5] = 0xf1;
-                //     vk_canbuf[6] = 0xf3;
-                // }
                 can_send_msg_normal((unsigned char *)&vk_canbuf, 8, vk_can_id);
             }
             break;
@@ -356,8 +344,13 @@ void Set_Seed_Weight_Par(uint8_t device_type,char *factory)
                     break;
                 //重量校准
                 case Weight_Kg:
+                {
+                    int weight_kgCal = 0;
+                    weight_kgCal = weight_order.order_con2 + weight_order.order_con3 * 65536;
+                
                     can_buf[0] = 0xF2;
-                    memcpy(&can_buf[1], &weight_order.order_con2,2);
+                    memcpy(&can_buf[1], &weight_kgCal,4);
+                }
                     break;
                 case Weight_Reserve:
                     break;
@@ -433,47 +426,100 @@ void Set_Seed_Weight_Par(uint8_t device_type,char *factory)
             }        
             break;
         case WEIGHT_DEVICE:
-            if(weight_order.type != 0)   
-            {
-                can_buf[1] = 0x00;
+            if(eft_weightDev_priority == true)
+            {                    
+                can_buf[1] = 0x00;  //D1 - D4
                 can_buf[2] = 0x00;
                 can_buf[3] = 0x00;
                 can_buf[4] = 0x00;
-                can_buf[5] = 0xf1;
-                can_buf[6] = 0xf3;
-                can_buf[7] = 0;
+                can_buf[5] = 0xF1;
+                can_buf[6] = 0xF3;
+                can_buf[7] = 0x00;  //D5
 
                 switch (weight_order.type)
                 {
+                //去皮校准
                 case Weight_Peer:
-                    can_buf[0] = 0xF6;
+                    can_buf[0] = 0xE1;
                     break;
+                //重量校准
                 case Weight_Kg:
-                    can_buf[0] = 0xF7;
-                    can_buf[1] = (weight_order.order_con2 >> 8) & 0xff;
-                    can_buf[2] = weight_order.order_con2 & 0xff;
+                    can_buf[0] = 0xE2;
+                    memcpy(&can_buf[1], &weight_order.order_con2,2);
                     break;
                 case Weight_Reserve:
                     break;
+                //恢复出厂设置
                 case Weight_Bcak:
-                    can_buf[0] = 0xF5;
+                    can_buf[0] = 0xF4;
                     break;
+                //称重传感器K值 
                 case Weight_Set_K:
-                    can_buf[0] = 0xFC;
-                    can_buf[1] = eft_info.seed_k[0];
-                    can_buf[2] = eft_info.seed_k[1];
-                    can_buf[3] = eft_info.seed_k[2];
-
-                    can_buf[weight_order.order_con1] = weight_order.order_con2 & 0xff;
-                      
+                    z70weight.buf[0] = 0xE3;
+                    if(weight_order.order_con1 == 1)
+                        z70weight.info.k1 = weight_order.order_con2;
+                    else if(weight_order.order_con1 == 2)
+                        z70weight.info.k2 = weight_order.order_con2;
+                    else if(weight_order.order_con1 == 3)
+                        z70weight.info.k3 = weight_order.order_con2;
+                    else if(weight_order.order_con1 == 4)
+                        z70weight.info.k4 = weight_order.order_con2;
+                    
+                    memcpy(&can_buf,&z70weight.buf[0],8);
                     break;
                 default:
                     break;
                 }
-                can_send_msg_normal((unsigned char *)&can_buf, 8, SEND_EFT_INFO);
+                can_send_msg_normal((unsigned char *)&can_buf, 8, 0x88BB);
                 HAL_Delay(10);
                 weight_order.type = 0;
             }
+            else
+            {
+                if(weight_order.type != 0)   
+                {
+
+                    can_buf[1] = 0x00;
+                    can_buf[2] = 0x00;
+                    can_buf[3] = 0x00;
+                    can_buf[4] = 0x00;
+                    can_buf[5] = 0xf1;
+                    can_buf[6] = 0xf3;
+                    can_buf[7] = 0;
+
+                    switch (weight_order.type)
+                    {
+                    case Weight_Peer:
+                        can_buf[0] = 0xF6;
+                        break;
+                    case Weight_Kg:
+                        can_buf[0] = 0xF7;
+                        can_buf[1] = (weight_order.order_con2 >> 8) & 0xff;
+                        can_buf[2] = weight_order.order_con2 & 0xff;
+                        break;
+                    case Weight_Reserve:
+                        break;
+                    case Weight_Bcak:
+                        can_buf[0] = 0xF5;
+                        break;
+                    case Weight_Set_K:
+                        can_buf[0] = 0xFC;
+                        can_buf[1] = eft_info.seed_k[0];
+                        can_buf[2] = eft_info.seed_k[1];
+                        can_buf[3] = eft_info.seed_k[2];
+
+                        can_buf[weight_order.order_con1] = weight_order.order_con2 & 0xff;
+                        
+                        break;
+                    default:
+                        break;
+                    }
+                    can_send_msg_normal((unsigned char *)&can_buf, 8, SEND_EFT_INFO);
+                    HAL_Delay(10);
+                    weight_order.type = 0;
+                }
+            }
+            
             break;
         default:
             break;
@@ -594,43 +640,43 @@ void check_dev_type_link(void )
 
 }
 
-void DM_obs_test( void )
-{
-    static uint32_t time_50hz = 0;
-    static uint32_t time_49hz = 0;
-    static uint32_t time_48hz = 0;
-    static uint32_t time_47hz = 0;
-    uint8_t can_buf[8] = {0};
-    if(Check_Timer_Ready(&time_50hz,20))
-    {
-        memcpy(&can_buf[0],&planep.QuaterQ0,4);
-        memcpy(&can_buf[4],&planep.QuaterQ1,4);
-        can_send_msg_normal((unsigned char *)&can_buf, 8, 0x2345);   
-    }
-
-    if(Check_Timer_Ready(&time_49hz,20))
-    {
-        memcpy(&can_buf[0],&planep.QuaterQ2,4);
-        memcpy(&can_buf[4],&planep.QuaterQ3,4);
-        can_send_msg_normal((unsigned char *)&can_buf, 8, 0x2346);
-    }
-
-    if(Check_Timer_Ready(&time_48hz,50))
-    {
-        memcpy(&can_buf[0],&planep.pos_x,4);
-        memcpy(&can_buf[4],&planep.pos_y,4);
-        can_send_msg_normal((unsigned char *)&can_buf, 8, 0x2347);
-    }
-
-    if(Check_Timer_Ready(&time_47hz,50))
-    {
-        memcpy(&can_buf[0],&planep.pos_z,4);
-        memcpy(&can_buf[4],&planep.pos_flag,4);
-        can_send_msg_normal((unsigned char *)&can_buf, 8, 0x2348);
-    }
-
-
-}
+// void DM_obs_test( void )
+// {
+//     static uint32_t time_50hz = 0;
+//     static uint32_t time_49hz = 0;
+//     static uint32_t time_48hz = 0;
+//     static uint32_t time_47hz = 0;
+//     uint8_t can_buf[8] = {0};
+//     if(Check_Timer_Ready(&time_50hz,20))
+//     {
+//         memcpy(&can_buf[0],&planep.QuaterQ0,4);
+//         memcpy(&can_buf[4],&planep.QuaterQ1,4);
+//         can_send_msg_normal((unsigned char *)&can_buf, 8, 0x2345);   
+//     }
+
+//     if(Check_Timer_Ready(&time_49hz,20))
+//     {
+//         memcpy(&can_buf[0],&planep.QuaterQ2,4);
+//         memcpy(&can_buf[4],&planep.QuaterQ3,4);
+//         can_send_msg_normal((unsigned char *)&can_buf, 8, 0x2346);
+//     }
+
+//     if(Check_Timer_Ready(&time_48hz,50))
+//     {
+//         memcpy(&can_buf[0],&planep.pos_x,4);
+//         memcpy(&can_buf[4],&planep.pos_y,4);
+//         can_send_msg_normal((unsigned char *)&can_buf, 8, 0x2347);
+//     }
+
+//     if(Check_Timer_Ready(&time_47hz,50))
+//     {
+//         memcpy(&can_buf[0],&planep.pos_z,4);
+//         memcpy(&can_buf[4],&planep.pos_flag,4);
+//         can_send_msg_normal((unsigned char *)&can_buf, 8, 0x2348);
+//     }
+
+
+// }
 /**
   * @file    update_device_type_data
   * @brief   更新设备信息
@@ -683,7 +729,6 @@ void  update_device_type_data(void)
 
     if(Check_Timer_Ready(&time_50hz,_50_HZ_))
     {
-        //tes_mmm();
         //好盈电调水泵
         Hobbywing_esc_func();
         //播撒器
@@ -744,6 +789,16 @@ void  update_device_type_data(void)
                 Dev.Weight.k4 = 0;
                 Dev.Weight.warn = eft_info.watering_warn_status >> 4 & 0xff;
                 break;
+            case FAC_LIFTWEIGHT:
+                Dev.Weight.mode = 0;
+                Dev.Weight.kg = eft_info.weight;
+                Dev.Weight.rate = 0;
+                Dev.Weight.k1 = eft_info.seed_k[0];
+                Dev.Weight.k2 = eft_info.seed_k[1];
+                Dev.Weight.k3 = eft_info.seed_k[2];
+                Dev.Weight.k4 = 0;
+                Dev.Weight.warn = (LiftingWeight_warning << 8) & 0xff00; 
+                break;
             case FAC_QIFEI:
                 Dev.Weight.mode = weight_vkinfo.mode;
                 Dev.Weight.kg = weight_vkinfo.weight / 10;
@@ -856,6 +911,8 @@ void  update_device_type_data(void)
             case FAC_VK:
                 break;
             case FAC_EFT:
+                Dev.L_pump1.warn = Lpump1.error_status;
+                Dev.L_pump1.rpm =  Lpump1.rpm;
                 break;
             case FAC_HW_ESC:
                 Dev.L_pump1.warn = EscMsg[1].warn_flag;
@@ -872,6 +929,8 @@ void  update_device_type_data(void)
             case FAC_VK:
                 break;
             case FAC_EFT:
+                Dev.L_pump2.warn = Lpump2.error_status;
+                Dev.L_pump2.rpm =  Lpump2.rpm;
                 break;
             case FAC_HW_ESC:
                 Dev.L_pump2.warn = EscMsg[2].warn_flag;

+ 17 - 4
Src/soft_version.c

@@ -440,19 +440,32 @@ void get_flowmeter_version_and_sn(void)
 void get_seed_version_and_sn(void)
 {
     static uint8_t get_counts = 5;
-    static uint32_t get_time = 0;
     uint8_t can_buf[8] = {0}; 
-    if(Dev.Weight_Link.connect_status == COMP_NORMAL && Dev.Weight.facid == FAC_VK && get_counts > 0 &&
-        HAL_GetTick() - get_time > 1000)
+    if(Dev.Weight_Link.connect_status == COMP_NORMAL && Dev.Weight.facid == FAC_VK && get_counts > 0)
     {
         can_buf[0] = 0xF6;
         can_buf[5] = 0xFE;
         can_buf[6] = 0xFE;
 
         can_send_msg_normal(&can_buf[0], 8, 0x81321);
-        get_time = HAL_GetTick();
         get_counts--;
     }
+
+    if( dev_weight.regist.sn == false &&Dev.Weight_Link.connect_status == COMP_NORMAL && Dev.Weight.facid == FAC_LIFTWEIGHT)
+    {
+        put_date_to_can(can_buf,0xF3,0,0,0,0,0xF1,0xF3,0 );
+        can_send_msg_normal(&can_buf[0], 8, 0X88BB);
+    }
+    else if(dev_weight.regist.soft == false && Dev.Weight_Link.connect_status == COMP_NORMAL && Dev.Weight.facid == FAC_LIFTWEIGHT)
+    {
+        put_date_to_can(can_buf,0xF4,0,0,0,0,0xF1,0xF3,0 );
+        can_send_msg_normal(&can_buf[0], 8, 0X88BB);
+    }
+    else if(weight_runing_time == false && Dev.Weight_Link.connect_status == COMP_NORMAL && Dev.Weight.facid == FAC_LIFTWEIGHT)
+    {
+        put_date_to_can(can_buf,0xF5,0,0,0,0,0xF1,0xF3,0 );
+        can_send_msg_normal(&can_buf[0], 8, 0X88BB);
+    }
 }
 
 

+ 0 - 1
Src/soft_water_device.c

@@ -7,7 +7,6 @@
 #include "soft_crc.h"
 #include "soft_version.h"
 
-
 /**
   * @file    liquid_recieved_hookfuction
   * @brief   液位计解析

BIN
binfile/V9_AG_PMU_APP_20250528.bin


BIN
build/V9_AG_PMU_APP_.bin