IO mixer - cleanup FMU timeout check (comments and indentation)

This commit is contained in:
bresch 2019-04-01 12:07:56 +02:00 committed by Beat Küng
parent c576c57d7b
commit 776b1a28de
1 changed files with 6 additions and 13 deletions

View File

@ -223,20 +223,13 @@ mixer_tick(void)
); );
/* /*
* Check if failsafe termination is set - if yes, * Check if FMU is still alive, if not, terminate the flight
* set the force failsafe flag once entering the first
* failsafe condition.
*/ */
if ( /* Flight termination is allowed */ if (REG_TO_BOOL(r_setup_flighttermination) && /* Flight termination is allowed */
REG_TO_BOOL(r_setup_flighttermination) && (source == MIX_DISARMED) && /* and if we ended up not changing the default mixer */
/* If we ended up not changing the default mixer */ should_arm && /* and we should be armed, so we intended to provide outputs */
(source == MIX_DISARMED) && (r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_INITIALIZED)) { /* and FMU is initialized */
/* and we should be armed, so we intended to provide outputs */ PX4_ATOMIC_MODIFY_OR(r_setup_arming, PX4IO_P_SETUP_ARMING_FORCE_FAILSAFE); /* then FMU is dead -> terminate flight */
should_arm &&
/* and FMU is initialized */
(r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_INITIALIZED)) {
/* FMU is then dead -> force failsafe */
PX4_ATOMIC_MODIFY_OR(r_setup_arming, PX4IO_P_SETUP_ARMING_FORCE_FAILSAFE);
} }
/* /*