RC_Channel: make has_new_overrides non-static

This commit is contained in:
Peter Barker 2019-03-29 21:59:29 +11:00 committed by Andrew Tridgell
parent 2331232bdd
commit e869eaeda4
3 changed files with 7 additions and 4 deletions

View File

@ -338,7 +338,7 @@ void RC_Channel::set_override(const uint16_t v, const uint32_t timestamp_us)
} }
last_override_time = timestamp_us != 0 ? timestamp_us : AP_HAL::millis(); last_override_time = timestamp_us != 0 ? timestamp_us : AP_HAL::millis();
override_value = v; override_value = v;
RC_Channels::has_new_overrides = true; rc().new_override_received();
} }
void RC_Channel::clear_override() void RC_Channel::clear_override()

View File

@ -354,12 +354,17 @@ protected:
IGNORE_FAILSAFE = (1 << 2), // ignore RC failsafe bits IGNORE_FAILSAFE = (1 << 2), // ignore RC failsafe bits
}; };
void new_override_received() {
has_new_overrides = true;
}
private: private:
static RC_Channels *_singleton; static RC_Channels *_singleton;
// this static arrangement is to avoid static pointers in AP_Param tables // this static arrangement is to avoid static pointers in AP_Param tables
static RC_Channel *channels; static RC_Channel *channels;
static bool has_new_overrides; bool has_new_overrides;
AP_Float _override_timeout; AP_Float _override_timeout;
AP_Int32 _options; AP_Int32 _options;

View File

@ -28,8 +28,6 @@ extern const AP_HAL::HAL& hal;
#include "RC_Channel.h" #include "RC_Channel.h"
bool RC_Channels::has_new_overrides;
/* /*
channels group object constructor channels group object constructor
*/ */