mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 01:53:34 +08:00
mavlink update to latest and enable address-of-packed-member warning
This commit is contained in:
@@ -450,8 +450,7 @@ MavlinkParametersManager::send_uavcan()
|
||||
msg.param_value = value.real_value;
|
||||
|
||||
} else {
|
||||
int32_t val;
|
||||
val = (int32_t)value.int_value;
|
||||
int32_t val = (int32_t)value.int_value;
|
||||
memcpy(&msg.param_value, &val, sizeof(int32_t));
|
||||
msg.param_type = MAVLINK_TYPE_INT32_T;
|
||||
}
|
||||
@@ -545,14 +544,19 @@ MavlinkParametersManager::send_param(param_t param, int component_id)
|
||||
* get param value, since MAVLink encodes float and int params in the same
|
||||
* space during transmission, copy param onto float val_buf
|
||||
*/
|
||||
if (param_get(param, &msg.param_value) != OK) {
|
||||
float param_value{};
|
||||
|
||||
if (param_get(param, ¶m_value) != OK) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
msg.param_value = param_value;
|
||||
|
||||
msg.param_count = param_count_used();
|
||||
msg.param_index = param_get_used_index(param);
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 8
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
#endif
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user