mc_pos_control: assign events field outside of initializer

Necessary because NuttX defines pollfd differend from
the POSIX standard. The difference of field order makes
use of C++ designated initializers to compile for both
platforms impossible.
This commit is contained in:
Matthias Grob
2018-12-04 11:54:11 +01:00
committed by Beat Küng
parent 09e563addd
commit 513c973f01
@@ -595,7 +595,8 @@ MulticopterPositionControl::run()
_att_sp.landing_gear = vehicle_attitude_setpoint_s::LANDING_GEAR_DOWN;
// setup file descriptor to poll the local position as loop wakeup source
px4_pollfd_struct_t poll_fd = {.fd = _local_pos_sub, .events = POLLIN};
px4_pollfd_struct_t poll_fd = {.fd = _local_pos_sub};
poll_fd.events = POLLIN;
while (!should_exit()) {
// poll for new data on the local position state topic (wait for up to 20ms)