Skip to content
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

Merged
merged 2 commits into from May 17, 2021

Conversation

klutvott123
Copy link
Member

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 in init() 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() and gyroDataAnalyseInit() to reclaim some flash.

@@ -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.
Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

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...

@mikeller mikeller added this to the 4.3 milestone Apr 26, 2021
@mikeller mikeller merged commit adc2008 into betaflight:master May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants