RC_Channel: added RC_OPTIONS flag for failsafe ignore

this is useful for SBUS with a receiver setup for HOLD on failsafe to
not trigger a RC failsafe
This commit is contained in:
Andrew Tridgell 2019-03-12 08:26:59 +11:00
parent 4f136512f0
commit 59082a0833
2 changed files with 7 additions and 1 deletions

View File

@ -26,6 +26,7 @@ public:
enum InputIgnore {
RC_IGNORE_RECEIVER = (1 << 0), // RC receiver modules
RC_IGNORE_OVERRIDES = (1 << 1), // MAVLink overrides
RC_IGNORE_FAILSAFE = (1 << 2), // ignore RC failsafe bits
};
enum ChannelType {
@ -340,6 +341,11 @@ public:
}
}
// should we ignore RC failsafe bits from receivers?
static bool ignore_rc_failsafe(void) {
return options && ((*options) & RC_Channel::RC_IGNORE_FAILSAFE) != 0;
}
private:
static RC_Channels *_singleton;
// this static arrangement is to avoid static pointers in AP_Param tables

View File

@ -86,7 +86,7 @@ const AP_Param::GroupInfo RC_Channels::var_info[] = {
// @DisplayName: RC options
// @Description: RC input options
// @User: Advanced
// @Bitmask: 0:Ignore RC Receiver, 1:Ignore MAVLink Overrides
// @Bitmask: 0:Ignore RC Receiver, 1:Ignore MAVLink Overrides, 2:Ignore Receiver Failsafe
AP_GROUPINFO("_OPTIONS", 33, RC_CHANNELS_SUBCLASS, _options, 0),
AP_GROUPEND