|
@@ -41,7 +41,7 @@ void Weight_recieved_hookfuction(uint32_t CanID, uint8_t data[], uint8_t len)
|
|
|
|
|
|
|
|
Dev.Weight.facid = FAC_VK;
|
|
Dev.Weight.facid = FAC_VK;
|
|
|
Dev.Weight_Link.connect_status = COMP_NORMAL;
|
|
Dev.Weight_Link.connect_status = COMP_NORMAL;
|
|
|
- Dev.Weight_Link.recv_time = HAL_GetTick();
|
|
|
|
|
|
|
+ Dev.Weight_Link.recv_time = HAL_GetTick();
|
|
|
|
|
|
|
|
break;
|
|
break;
|
|
|
//称重传感器设置回馈
|
|
//称重传感器设置回馈
|
|
@@ -64,7 +64,7 @@ void Weight_recieved_hookfuction(uint32_t CanID, uint8_t data[], uint8_t len)
|
|
|
break;
|
|
break;
|
|
|
case 0xf6:
|
|
case 0xf6:
|
|
|
{
|
|
{
|
|
|
- char ver_buf[8] = {0};
|
|
|
|
|
|
|
+ char ver_buf[10] = {0};
|
|
|
int ver_temp32 = 0;
|
|
int ver_temp32 = 0;
|
|
|
memcpy(&ver_temp32,&data[1],4);
|
|
memcpy(&ver_temp32,&data[1],4);
|
|
|
Int2String(ver_temp32,&ver_buf[2],6);
|
|
Int2String(ver_temp32,&ver_buf[2],6);
|
|
@@ -422,7 +422,6 @@ void Set_Seed_Weight_Par(uint8_t device_type,char *factory)
|
|
|
can_buf[7] = 0;
|
|
can_buf[7] = 0;
|
|
|
|
|
|
|
|
can_send_msg_normal((unsigned char *)&can_buf, 8, SEND_EFT_INFO);
|
|
can_send_msg_normal((unsigned char *)&can_buf, 8, SEND_EFT_INFO);
|
|
|
- HAL_Delay(10);
|
|
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case WEIGHT_DEVICE:
|
|
case WEIGHT_DEVICE:
|
|
@@ -471,7 +470,6 @@ void Set_Seed_Weight_Par(uint8_t device_type,char *factory)
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
can_send_msg_normal((unsigned char *)&can_buf, 8, 0x88BB);
|
|
can_send_msg_normal((unsigned char *)&can_buf, 8, 0x88BB);
|
|
|
- HAL_Delay(10);
|
|
|
|
|
weight_order.type = 0;
|
|
weight_order.type = 0;
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
@@ -515,7 +513,6 @@ void Set_Seed_Weight_Par(uint8_t device_type,char *factory)
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
can_send_msg_normal((unsigned char *)&can_buf, 8, SEND_EFT_INFO);
|
|
can_send_msg_normal((unsigned char *)&can_buf, 8, SEND_EFT_INFO);
|
|
|
- HAL_Delay(10);
|
|
|
|
|
weight_order.type = 0;
|
|
weight_order.type = 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -640,43 +637,44 @@ 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 )
|
|
|
|
|
+{
|
|
|
|
|
+ if(Dev.Part_Fradar_Link.connect_status != COMP_NORMAL)
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+ 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,19))
|
|
|
|
|
+ {
|
|
|
|
|
+ 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,19))
|
|
|
|
|
+ {
|
|
|
|
|
+ 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
|
|
* @file update_device_type_data
|
|
|
* @brief 更新设备信息
|
|
* @brief 更新设备信息
|
|
@@ -1147,6 +1145,19 @@ void update_device_type_data(void)
|
|
|
Dev.Part_radarT.height_part3 = T_radar[2].Distance * 0.05f * 100 * cos(T_radar[2].Amuzith * 0.1f / RAD);
|
|
Dev.Part_radarT.height_part3 = T_radar[2].Distance * 0.05f * 100 * cos(T_radar[2].Amuzith * 0.1f / RAD);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if(Dev.Part_Fradar_Link.connect_status == COMP_NORMAL)
|
|
|
|
|
+ {
|
|
|
|
|
+ Dev.Part_radarF.X1 = F_4DRadar[0][0];
|
|
|
|
|
+ Dev.Part_radarF.Y1 = F_4DRadar[0][1];
|
|
|
|
|
+ Dev.Part_radarF.Z1 = F_4DRadar[0][2];
|
|
|
|
|
+ Dev.Part_radarF.X2 = F_4DRadar[1][0];
|
|
|
|
|
+ Dev.Part_radarF.Y2 = F_4DRadar[1][1];
|
|
|
|
|
+ Dev.Part_radarF.Z2 = F_4DRadar[1][2];
|
|
|
|
|
+ Dev.Part_radarF.X3 = F_4DRadar[2][0];
|
|
|
|
|
+ Dev.Part_radarF.Y3 = F_4DRadar[2][1];
|
|
|
|
|
+ Dev.Part_radarF.Z3 = F_4DRadar[2][2];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if(Dev.Temp_Sensor_Link.connect_status == COMP_NORMAL)
|
|
if(Dev.Temp_Sensor_Link.connect_status == COMP_NORMAL)
|
|
|
{
|
|
{
|
|
|
switch (Dev.Temp_sensor.facid)
|
|
switch (Dev.Temp_sensor.facid)
|