1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Fixed conditions for RC smoothing validation.

This commit is contained in:
mikeller 2018-07-01 15:12:21 +12:00
parent 47b2620672
commit fb83ea4b52
3 changed files with 13 additions and 6 deletions

View file

@ -245,18 +245,15 @@ static void validateAndFixConfig(void)
rxConfigMutable()->rssi_src_frame_errors = false;
}
if ((
#if defined(USE_RC_SMOOTHING_FILTER)
rxConfig()->rc_smoothing_type == RC_SMOOTHING_TYPE_INTERPOLATION &&
#endif
rxConfig()->rcInterpolation == RC_SMOOTHING_OFF) || rxConfig()->rcInterpolationChannels == INTERPOLATION_CHANNELS_T) {
if (rcSmoothingIsOff() || rxConfig()->rcInterpolationChannels == INTERPOLATION_CHANNELS_T) {
for (unsigned i = 0; i < MAX_PROFILE_COUNT; i++) {
pidProfilesMutable(i)->dtermSetpointWeight = 0;
}
}
#if defined(USE_THROTTLE_BOOST)
if (!(rxConfig()->rcInterpolationChannels == INTERPOLATION_CHANNELS_RPYT
if (rcSmoothingIsOff() ||
!(rxConfig()->rcInterpolationChannels == INTERPOLATION_CHANNELS_RPYT
|| rxConfig()->rcInterpolationChannels == INTERPOLATION_CHANNELS_T
|| rxConfig()->rcInterpolationChannels == INTERPOLATION_CHANNELS_RPT)) {
for (unsigned i = 0; i < MAX_PROFILE_COUNT; i++) {

View file

@ -732,6 +732,15 @@ void initRcProcessing(void)
}
}
bool rcSmoothingIsOff(void)
{
return (
#if defined(USE_RC_SMOOTHING_FILTER)
rxConfig()->rc_smoothing_type == RC_SMOOTHING_TYPE_INTERPOLATION &&
#endif
rxConfig()->rcInterpolation == RC_SMOOTHING_OFF);
}
#ifdef USE_RC_SMOOTHING_FILTER
int rcSmoothingGetValue(int whichValue)
{

View file

@ -39,5 +39,6 @@ void updateRcCommands(void);
void resetYawAxis(void);
void initRcProcessing(void);
bool isMotorsReversed(void);
bool rcSmoothingIsOff(void);
int rcSmoothingGetValue(int whichValue);
bool rcSmoothingAutoCalculate(void);