mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-13 20:03:33 +08:00
EKF: remove use of memset to initialise variable
When using a union of flags and integer value it is safer to initialise the value to 0 rather than memset the flags because the flags may not define all bits in the integer.
This commit is contained in:
@@ -435,7 +435,7 @@ bool EstimatorInterface::initialise_interface(uint64_t timestamp)
|
||||
_time_last_range = 0;
|
||||
_time_last_airspeed = 0;
|
||||
_time_last_optflow = 0;
|
||||
memset(&_fault_status.flags, 0, sizeof(_fault_status.flags));
|
||||
_fault_status.value = 0;
|
||||
_time_last_ext_vision = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user