British Safety Rules: Failsafe on RC loss in all cases

This commit is contained in:
Christophe De Wagter
2015-11-11 12:44:03 +01:00
parent 2132090693
commit a9e9ff8d08
3 changed files with 15 additions and 1 deletions
@@ -45,6 +45,7 @@
<configure name="ACTUATORS_SPEKTRUM_DEV2" value="UART6"/>
</subsystem>
<define name="RC_LOST_FBW_MODE" value="FBW_MODE_FAILSAFE"/><!-- Switch to Failsafe or to Autopilot on RC loss? -->
<define name="RC_LOST_IN_AUTO_FBW_MODE" value="FBW_MODE_FAILSAFE"/><!-- Switch to Failsafe with a working autopilot on RC loss? -->
<define name="AP_LOST_FBW_MODE" value="FBW_MODE_MANUAL"/><!-- Switch to Failsafe or to Manual on AP loss? -->
<subsystem name="intermcu" type="uart">
+7 -1
View File
@@ -159,7 +159,13 @@ STATIC_INLINE void main_periodic(void)
if (fbw_mode == FBW_MODE_MANUAL) {
fbw_mode = RC_LOST_FBW_MODE;
} else {
// No change: failsafe stays failsafe, auto stays auto
if (fbw_mode == FBW_MODE_FAILSAFE)
{
// No change: failsafe stays failsafe
} else {
// Lost RC while in working Auto mode
fbw_mode = RC_LOST_IN_AUTO_FBW_MODE;
}
}
}
} else { // rc_is_good
@@ -47,11 +47,18 @@
#define RC_LOST_FBW_MODE FBW_MODE_FAILSAFE
#endif
/** mode to enter when AP is lost while using autopilot */
#ifndef RC_LOST_IN_AUTO_FBW_MODE
#define RC_LOST_IN_AUTO_FBW_MODE FBW_MODE_AUTO
#endif
/** mode to enter when AP is lost while using autopilot */
#ifndef AP_LOST_FBW_MODE
#define AP_LOST_FBW_MODE FBW_MODE_FAILSAFE
#endif
/** Switching between FBW and autopilot is done with RADIO_FBW_MODE: default is to re-use RADIO_MODE */
#ifndef RADIO_FBW_MODE