mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 15:53:56 -04:00
Copter: allow radio failsafe while disarmed so that user can be notified
This commit is contained in:
parent
21beb26484
commit
cafb38e923
@ -122,7 +122,7 @@ static void read_radio()
|
|||||||
uint32_t elapsed = tnow_ms - last_update_ms;
|
uint32_t elapsed = tnow_ms - last_update_ms;
|
||||||
// turn on throttle failsafe if no update from the RC Radio for 500ms or 2000ms if we are using RC_OVERRIDE
|
// turn on throttle failsafe if no update from the RC Radio for 500ms or 2000ms if we are using RC_OVERRIDE
|
||||||
if (((!failsafe.rc_override_active && (elapsed >= FS_RADIO_TIMEOUT_MS)) || (failsafe.rc_override_active && (elapsed >= FS_RADIO_RC_OVERRIDE_TIMEOUT_MS))) &&
|
if (((!failsafe.rc_override_active && (elapsed >= FS_RADIO_TIMEOUT_MS)) || (failsafe.rc_override_active && (elapsed >= FS_RADIO_RC_OVERRIDE_TIMEOUT_MS))) &&
|
||||||
(g.failsafe_throttle && motors.armed() && !failsafe.radio)) {
|
(g.failsafe_throttle && (ap.rc_receiver_present||motors.armed()) && !failsafe.radio)) {
|
||||||
Log_Write_Error(ERROR_SUBSYSTEM_RADIO, ERROR_CODE_RADIO_LATE_FRAME);
|
Log_Write_Error(ERROR_SUBSYSTEM_RADIO, ERROR_CODE_RADIO_LATE_FRAME);
|
||||||
set_failsafe_radio(true);
|
set_failsafe_radio(true);
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@ static void set_throttle_and_failsafe(uint16_t throttle_pwm)
|
|||||||
if (throttle_pwm < (uint16_t)g.failsafe_throttle_value) {
|
if (throttle_pwm < (uint16_t)g.failsafe_throttle_value) {
|
||||||
|
|
||||||
// if we are already in failsafe or motors not armed pass through throttle and exit
|
// if we are already in failsafe or motors not armed pass through throttle and exit
|
||||||
if (failsafe.radio || !motors.armed()) {
|
if (failsafe.radio || !(ap.rc_receiver_present || motors.armed())) {
|
||||||
g.rc_3.set_pwm(throttle_pwm);
|
g.rc_3.set_pwm(throttle_pwm);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user