[rotorcraft] add FAILSAFE_ON_BAT_CRITICAL

set FAILSAFE_ON_BAT_CRITICAL to TRUE if you want to go into FAILSAFE mode (neutral attitude, slowly descend)
if battery status is critical (vsupply voltage below CRITIC_BAT_LEVEL for a while)
This commit is contained in:
Felix Ruess
2013-09-01 17:00:43 +02:00
parent e3082044c9
commit 9489857f01
+8
View File
@@ -222,6 +222,14 @@ STATIC_INLINE void failsafe_check( void ) {
autopilot_set_mode(AP_MODE_FAILSAFE); autopilot_set_mode(AP_MODE_FAILSAFE);
} }
#if FAILSAFE_ON_BAT_CRITICAL
if (autopilot_mode != AP_MODE_KILL &&
electrical.bat_critical)
{
autopilot_set_mode(AP_MODE_FAILSAFE);
}
#endif
#if USE_GPS #if USE_GPS
if (autopilot_mode == AP_MODE_NAV && if (autopilot_mode == AP_MODE_NAV &&
autopilot_motors_on && autopilot_motors_on &&