mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-05 06:54:49 +08:00
[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:
@@ -222,6 +222,14 @@ STATIC_INLINE void failsafe_check( void ) {
|
||||
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 (autopilot_mode == AP_MODE_NAV &&
|
||||
autopilot_motors_on &&
|
||||
|
||||
Reference in New Issue
Block a user