mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 17:43:34 +08:00
PX4ioFirmware - Clean should_arm, should_arm_nothrottle and should_always_enable_pwm indentation for better understanding
This commit is contained in:
@@ -200,25 +200,28 @@ mixer_tick(void)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
should_arm = (
|
should_arm = (
|
||||||
/* IO initialised without error */ (r_status_flags & PX4IO_P_STATUS_FLAGS_INIT_OK)
|
(r_status_flags & PX4IO_P_STATUS_FLAGS_INIT_OK) /* IO initialised without error */
|
||||||
/* and IO is armed */ && (r_status_flags & PX4IO_P_STATUS_FLAGS_SAFETY_OFF)
|
&& (r_status_flags & PX4IO_P_STATUS_FLAGS_SAFETY_OFF) /* and IO is armed */
|
||||||
/* and FMU is armed */ && (
|
&& (
|
||||||
((r_setup_arming & PX4IO_P_SETUP_ARMING_FMU_ARMED)
|
((r_setup_arming & PX4IO_P_SETUP_ARMING_FMU_ARMED) /* and FMU is armed */
|
||||||
/* and there is valid input via or mixer */ && (r_status_flags & PX4IO_P_STATUS_FLAGS_MIXER_OK))
|
&& (r_status_flags & PX4IO_P_STATUS_FLAGS_MIXER_OK)) /* and there is valid input via or mixer */
|
||||||
/* or direct PWM is set */ || (r_status_flags & PX4IO_P_STATUS_FLAGS_RAW_PWM)
|
|| (r_status_flags & PX4IO_P_STATUS_FLAGS_RAW_PWM) /* or direct PWM is set */
|
||||||
/* or failsafe was set manually */ || ((r_setup_arming & PX4IO_P_SETUP_ARMING_FAILSAFE_CUSTOM)
|
|| ((r_setup_arming & PX4IO_P_SETUP_ARMING_FAILSAFE_CUSTOM) /* or failsafe was set manually */
|
||||||
&& !(r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_OK))
|
&& !(r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_OK)) /* and FMU is not active */
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
should_arm_nothrottle = (
|
should_arm_nothrottle = (
|
||||||
/* IO initialised without error */ (r_status_flags & PX4IO_P_STATUS_FLAGS_INIT_OK)
|
(r_status_flags & PX4IO_P_STATUS_FLAGS_INIT_OK) /* IO initialised without error */
|
||||||
/* and IO is armed */ && (r_status_flags & PX4IO_P_STATUS_FLAGS_SAFETY_OFF)
|
&& (r_status_flags & PX4IO_P_STATUS_FLAGS_SAFETY_OFF) /* and IO is armed */
|
||||||
/* and there is valid input via or mixer */ && (r_status_flags & PX4IO_P_STATUS_FLAGS_MIXER_OK));
|
&& (r_status_flags & PX4IO_P_STATUS_FLAGS_MIXER_OK) /* and there is valid input via or mixer */
|
||||||
|
);
|
||||||
|
|
||||||
should_always_enable_pwm = (r_setup_arming & PX4IO_P_SETUP_ARMING_ALWAYS_PWM_ENABLE)
|
should_always_enable_pwm = (
|
||||||
&& (r_status_flags & PX4IO_P_STATUS_FLAGS_INIT_OK)
|
(r_setup_arming & PX4IO_P_SETUP_ARMING_ALWAYS_PWM_ENABLE)
|
||||||
&& (r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_OK);
|
&& (r_status_flags & PX4IO_P_STATUS_FLAGS_INIT_OK)
|
||||||
|
&& (r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_OK)
|
||||||
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if failsafe termination is set - if yes,
|
* Check if failsafe termination is set - if yes,
|
||||||
|
|||||||
Reference in New Issue
Block a user