Clean up lowpass patch
This commit is contained in:
parent
0043fb4b12
commit
4bcedab3e9
|
@ -428,7 +428,7 @@ static void resetConf(void)
|
|||
|
||||
currentProfile->mixerConfig.yaw_direction = 1;
|
||||
currentProfile->mixerConfig.tri_unarmed_servo = 1;
|
||||
currentProfile->mixerConfig.servo_lowpass_freq_idx = 21;
|
||||
currentProfile->mixerConfig.servo_lowpass_freq_idx = 99;
|
||||
currentProfile->mixerConfig.servo_lowpass_enable = 0;
|
||||
|
||||
// gimbal
|
||||
|
|
|
@ -25,13 +25,12 @@
|
|||
|
||||
#include "common/axis.h"
|
||||
#include "common/maths.h"
|
||||
#if 1
|
||||
|
||||
#include "drivers/gpio.h"
|
||||
#include "drivers/timer.h"
|
||||
#include "drivers/pwm_output.h"
|
||||
#include "drivers/pwm_mapping.h"
|
||||
|
||||
#endif
|
||||
#include "rx/rx.h"
|
||||
#include "io/gimbal.h"
|
||||
#include "io/escservo.h"
|
||||
|
@ -232,7 +231,6 @@ void mixerUseConfigs(servoParam_t *servoConfToUse, flight3DConfig_t *flight3DCon
|
|||
gimbalConfig = gimbalConfigToUse;
|
||||
}
|
||||
|
||||
#if 1
|
||||
|
||||
int16_t determineServoMiddleOrForwardFromChannel(int nr)
|
||||
{
|
||||
|
@ -659,46 +657,6 @@ bool isMixerUsingServos(void)
|
|||
{
|
||||
return useServo;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
static float notchFilter(notchFilter_t *filter, float in, int16_t freqIdx )
|
||||
{
|
||||
int16_t coefIdx;
|
||||
float out;
|
||||
|
||||
if (freqIdx != filter->freqIdx) {
|
||||
filter->init = false;
|
||||
}
|
||||
|
||||
if (!filter->init) {
|
||||
filter->freqIdx = freqIdx;
|
||||
filter->freq = notch_table[filter->freqIdx][0];
|
||||
filter->pCoef = ¬ch_table[filter->freqIdx][1];
|
||||
for (coefIdx = 0; coefIdx < NOTCH_FILTER_COEFS; coefIdx++) {
|
||||
filter->in[coefIdx] = in;
|
||||
filter->out[coefIdx] = in;
|
||||
}
|
||||
filter->init = true;
|
||||
}
|
||||
|
||||
filter->in[2] = filter->in[1];
|
||||
filter->in[1] = filter->in[0];
|
||||
filter->in[0] = in;
|
||||
filter->out[2] = filter->out[1];
|
||||
filter->out[1] = filter->out[0];
|
||||
|
||||
out = filter->in[0] * filter->pCoef[0] +
|
||||
filter->in[1] * filter->pCoef[1] +
|
||||
filter->in[2] * filter->pCoef[2] -
|
||||
(filter->out[1] * filter->pCoef[3] +
|
||||
filter->out[2] * filter->pCoef[4]);
|
||||
|
||||
filter->out[0] = out;
|
||||
|
||||
return out;
|
||||
}
|
||||
*/
|
||||
|
||||
static float lowpass(lowpass_t *filter, float in, int16_t freqIdx )
|
||||
{
|
||||
|
|
|
@ -332,8 +332,8 @@ const clivalue_t valueTable[] = {
|
|||
{ "yaw_control_direction", VAR_INT8 | MASTER_VALUE, &masterConfig.yaw_control_direction, -1, 1 },
|
||||
{ "yaw_direction", VAR_INT8 | PROFILE_VALUE, &masterConfig.profile[0].mixerConfig.yaw_direction, -1, 1 },
|
||||
{ "tri_unarmed_servo", VAR_INT8 | PROFILE_VALUE, &masterConfig.profile[0].mixerConfig.tri_unarmed_servo, 0, 1 },
|
||||
{ "servo_lowpass_freq_idx", VAR_INT16 | PROFILE_VALUE, &masterConfig.profile[0].mixerConfig.servo_lowpass_freq_idx, 0, 99},
|
||||
{ "servo_lowpass_enable", VAR_INT8 | PROFILE_VALUE, &masterConfig.profile[0].mixerConfig.servo_lowpass_enable, 0, 1 },
|
||||
{ "servo_lowpass_freq_idx", VAR_INT16 | PROFILE_VALUE, &masterConfig.profile[0].mixerConfig.servo_lowpass_freq_idx, 0, 99},
|
||||
{ "servo_lowpass_enable", VAR_INT8 | PROFILE_VALUE, &masterConfig.profile[0].mixerConfig.servo_lowpass_enable, 0, 1 },
|
||||
|
||||
{ "default_rate_profile", VAR_UINT8 | PROFILE_VALUE , &masterConfig.profile[0].defaultRateProfileIndex, 0, MAX_CONTROL_RATE_PROFILE_COUNT - 1 },
|
||||
{ "rc_rate", VAR_UINT8 | CONTROL_RATE_VALUE, &masterConfig.controlRateProfiles[0].rcRate8, 0, 250 },
|
||||
|
|
Loading…
Reference in New Issue