New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow re-initialising dynamic notch #10662
Allow re-initialising dynamic notch #10662
Conversation
aca5f11
to
eecdf4e
Compare
src/main/sensors/gyro.h
Outdated
@@ -201,8 +201,8 @@ typedef struct gyroConfig_s { | |||
|
|||
uint8_t gyro_filter_debug_axis; | |||
|
|||
uint8_t gyrosDetected; // What gyros should detection be attempted for on startup. Automatically set on first startup. | |||
uint8_t dyn_lpf_curve_expo; // set the curve for dynamic gyro lowpass filter | |||
uint8_t gyrosDetected; // What gyros should detection be attempted for on startup. Automatically set on first startup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going the wrong way - single space should be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed all of them to single use a single space.
{ | ||
#ifdef USE_MULTI_GYRO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this code is entirely unneeded and a remnant from a time when gyroDataAnalyseStateInit()
was called once for the initialisation of each gyro...
eecdf4e
to
242d5df
Compare
Currently the dynamic notch is the only filter that can't be re-initialised without a reboot. The reason is that
gyroDataAnalyseInit()
is allowed to run only once. I can only see two places where this is used and that's one time ininit()
and after receiving updated filter parameters through MSP.When tuning the dynamic notch parameters without rebooting nothing would happen. Then there may be too little filtering and possible flyaways on the next flight.
Removed the check that ony allows it to run once and combined
gyroDataAnalyseStateInit()
andgyroDataAnalyseInit()
to reclaim some flash.