mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 21:53:34 +08:00
IO board now disarms when FMU reboots when manual override is not an option
This commit is contained in:
@@ -93,13 +93,11 @@ mixer_tick(void)
|
|||||||
|
|
||||||
/* too long without FMU input, time to go to failsafe */
|
/* too long without FMU input, time to go to failsafe */
|
||||||
if (r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_OK) {
|
if (r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_OK) {
|
||||||
lowsyslog("AP RX timeout");
|
isr_debug(1, "AP RX timeout");
|
||||||
}
|
}
|
||||||
r_status_flags &= ~(PX4IO_P_STATUS_FLAGS_FMU_OK | PX4IO_P_STATUS_FLAGS_RAW_PWM);
|
r_status_flags &= ~(PX4IO_P_STATUS_FLAGS_FMU_OK | PX4IO_P_STATUS_FLAGS_RAW_PWM);
|
||||||
r_status_alarms |= PX4IO_P_STATUS_ALARMS_FMU_LOST;
|
r_status_alarms |= PX4IO_P_STATUS_ALARMS_FMU_LOST;
|
||||||
|
|
||||||
/* XXX this is questionable - vehicle may not make sense for direct control */
|
|
||||||
r_status_flags |= PX4IO_P_STATUS_FLAGS_OVERRIDE;
|
|
||||||
} else {
|
} else {
|
||||||
r_status_flags |= PX4IO_P_STATUS_FLAGS_FMU_OK;
|
r_status_flags |= PX4IO_P_STATUS_FLAGS_FMU_OK;
|
||||||
r_status_alarms &= ~PX4IO_P_STATUS_ALARMS_FMU_LOST;
|
r_status_alarms &= ~PX4IO_P_STATUS_ALARMS_FMU_LOST;
|
||||||
@@ -179,7 +177,10 @@ mixer_tick(void)
|
|||||||
/* FMU is armed */ (r_setup_arming & PX4IO_P_SETUP_ARMING_ARM_OK) &&
|
/* FMU is armed */ (r_setup_arming & PX4IO_P_SETUP_ARMING_ARM_OK) &&
|
||||||
/* IO is armed */ (r_status_flags & PX4IO_P_STATUS_FLAGS_ARMED) &&
|
/* IO is armed */ (r_status_flags & PX4IO_P_STATUS_FLAGS_ARMED) &&
|
||||||
/* there is valid input */ (r_status_flags & (PX4IO_P_STATUS_FLAGS_RAW_PWM | PX4IO_P_STATUS_FLAGS_MIXER_OK)) &&
|
/* there is valid input */ (r_status_flags & (PX4IO_P_STATUS_FLAGS_RAW_PWM | PX4IO_P_STATUS_FLAGS_MIXER_OK)) &&
|
||||||
/* IO initialised without error */ (r_status_flags & PX4IO_P_STATUS_FLAGS_INIT_OK));
|
/* IO initialised without error */ (r_status_flags & PX4IO_P_STATUS_FLAGS_INIT_OK) &&
|
||||||
|
/* FMU is available or FMU is not available but override is an option */
|
||||||
|
((r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_OK) || (!(r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_OK) && (r_setup_arming & PX4IO_P_SETUP_ARMING_MANUAL_OVERRIDE_OK) ))
|
||||||
|
);
|
||||||
|
|
||||||
if (should_arm && !mixer_servos_armed) {
|
if (should_arm && !mixer_servos_armed) {
|
||||||
/* need to arm, but not armed */
|
/* need to arm, but not armed */
|
||||||
|
|||||||
Reference in New Issue
Block a user