diff --git a/libraries/RC_Channel/RC_Channel.cpp b/libraries/RC_Channel/RC_Channel.cpp index 959088f322..8455983719 100644 --- a/libraries/RC_Channel/RC_Channel.cpp +++ b/libraries/RC_Channel/RC_Channel.cpp @@ -369,14 +369,14 @@ bool RC_Channel::has_override() const controller as it increases the influence of the users stick input, allowing the user full deflection if needed */ -int16_t RC_Channel::stick_mixing(const int16_t servo_in) +float RC_Channel::stick_mixing(const float servo_in) { float ch_inf = (float)(radio_in - radio_trim); ch_inf = fabsf(ch_inf); ch_inf = MIN(ch_inf, 400.0f); ch_inf = ((400.0f - ch_inf) / 400.0f); - int16_t servo_out = servo_in; + float servo_out = servo_in; servo_out *= ch_inf; servo_out += control_in; diff --git a/libraries/RC_Channel/RC_Channel.h b/libraries/RC_Channel/RC_Channel.h index 192430f90c..80220fd86e 100644 --- a/libraries/RC_Channel/RC_Channel.h +++ b/libraries/RC_Channel/RC_Channel.h @@ -71,7 +71,7 @@ public: void set_override(const uint16_t v, const uint32_t timestamp_ms); bool has_override() const; - int16_t stick_mixing(const int16_t servo_in); + float stick_mixing(const float servo_in); // get control input with zero deadzone int16_t get_control_in_zero_dz(void) const;