mirror of https://github.com/ArduPilot/ardupilot
RC_Channel: make RC PWM LIMITS variables
This commit is contained in:
parent
5bcc713985
commit
002b00f69d
|
@ -414,7 +414,7 @@ bool RC_Channel::read_6pos_switch(int8_t& position)
|
||||||
{
|
{
|
||||||
// calculate position of 6 pos switch
|
// calculate position of 6 pos switch
|
||||||
const uint16_t pulsewidth = get_radio_in();
|
const uint16_t pulsewidth = get_radio_in();
|
||||||
if (pulsewidth <= 900 || pulsewidth >= 2200) {
|
if (pulsewidth <= RC_MIN_LIMIT_PWM || pulsewidth >= RC_MAX_LIMIT_PWM) {
|
||||||
return false; // This is an error condition
|
return false; // This is an error condition
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1195,7 +1195,7 @@ void RC_Channel::init_aux()
|
||||||
bool RC_Channel::read_3pos_switch(RC_Channel::AuxSwitchPos &ret) const
|
bool RC_Channel::read_3pos_switch(RC_Channel::AuxSwitchPos &ret) const
|
||||||
{
|
{
|
||||||
const uint16_t in = get_radio_in();
|
const uint16_t in = get_radio_in();
|
||||||
if (in <= 900 or in >= 2200) {
|
if (in <= RC_MIN_LIMIT_PWM or in >= RC_MAX_LIMIT_PWM) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -257,6 +257,11 @@ public:
|
||||||
#if !HAL_MINIMIZE_FEATURES
|
#if !HAL_MINIMIZE_FEATURES
|
||||||
const char *string_for_aux_function(AUX_FUNC function) const;
|
const char *string_for_aux_function(AUX_FUNC function) const;
|
||||||
#endif
|
#endif
|
||||||
|
// pwm value under which we consider that Radio value is invalid
|
||||||
|
static const uint16_t RC_MIN_LIMIT_PWM = 900;
|
||||||
|
// pwm value above which we consider that Radio value is invalid
|
||||||
|
static const uint16_t RC_MAX_LIMIT_PWM = 2200;
|
||||||
|
|
||||||
// pwm value above which we condider that Radio min value is invalid
|
// pwm value above which we condider that Radio min value is invalid
|
||||||
static const uint16_t RC_CALIB_MIN_LIMIT_PWM = 1300;
|
static const uint16_t RC_CALIB_MIN_LIMIT_PWM = 1300;
|
||||||
// pwm value under which we condider that Radio max value is invalid
|
// pwm value under which we condider that Radio max value is invalid
|
||||||
|
|
Loading…
Reference in New Issue