[rotorcraft] don't force failsafe commands if motors are off

This commit is contained in:
Felix Ruess
2012-04-26 16:10:32 +02:00
parent 4a3b14581e
commit 23caa9ea03
+6 -3
View File
@@ -93,11 +93,14 @@ void autopilot_periodic(void) {
autopilot_detect_ground = FALSE;
}
#endif
if ( !autopilot_motors_on ||
/* set failsafe commands, if in FAILSAFE or KILL mode */
#ifndef FAILSAFE_GROUND_DETECT
autopilot_mode == AP_MODE_FAILSAFE ||
if (autopilot_mode == AP_MODE_KILL ||
autopilot_mode == AP_MODE_FAILSAFE) {
#else
if (autopilot_mode == AP_MODE_KILL) {
#endif
autopilot_mode == AP_MODE_KILL ) {
SetCommands(commands_failsafe,
autopilot_in_flight, autopilot_motors_on);
}