-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Comments
open filter for blueberryAT32F435#11319
open filter for blueberryAT32F435 #11319sunyanmeng963 wants to merge 1 commit intoiNavFlight:master from
Conversation
Branch Targeting Suggestion
You've targeted the master branch with this PR. Please consider if a version branch might be more appropriate:
-
maintenance-9.x- If your change is backward-compatible and won't create compatibility issues between INAV firmware and Configurator 9.x versions. This will allow your PR to be included in the next 9.x release. -
maintenance-10.x- If your change introduces compatibility requirements between firmware and configurator that would break 9.x compatibility. This is for PRs which will be included in INAV 10.x
If master is the correct target for this change, no action is needed.
This is an automated suggestion to help route contributions to the appropriate branch.
Review Summary by Qodo
Remove dynamic filter configuration from BLUEBERRYF435WING target
🐞 Bug fix
Walkthroughs
Description
• Remove unnecessary gyro filter configuration from target setup • Delete unused sensors/gyro.h include directive • Simplify BLUEBERRYF435WING configuration by removing dynamic filter logic
Diagram
flowchart LR
A["config.c file"] -- "Remove gyro.h include" --> B["Cleaned includes"]
A -- "Delete dynamic filter config block" --> C["Simplified targetConfiguration"]
B --> D["Final config.c"]
C --> D
File Changes
1. src/main/target/BLUEBERRYF435WING/config.c
🐞 Bug fix +0/-8
Remove gyro filter configuration from target
• Removed #include "sensors/gyro.h" header include • Deleted entire USE_DYNAMIC_FILTERS conditional block containing dynamic notch filter disable logic • Removed gyro configuration call gyroConfigMutable()->dynamicGyroNotchEnabled = 0 • Simplified target configuration by eliminating performance optimization comments
Code Review by Qodo
🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)
1. Dynamic notch default enabled 🐞 Bug ➹ Performance
Description
• BLUEBERRYF435WING no longer disables dynamic gyro notch in targetConfiguration(), so the target will now inherit the global default. • The global default for dynamic_gyro_notch_enabled is ON (when USE_DYNAMIC_FILTERS is enabled), meaning a config reset will turn it on for this board. • When enabled, the gyro loop performs additional analysis and applies multiple notch filters each cycle, increasing CPU load and risking timing overruns on tighter targets.
Code
src/main/target/BLUEBERRYF435WING/config.c[R38-41]serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART1)].functionMask = FUNCTION_MSP; serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART1)].msp_baudrateIndex = BAUD_115200; //pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1; - -#ifdef USE_DYNAMIC_FILTERS - // Disable dynamic notch filter by default (performance optimization for wing) - // This board is performance-constrained and wing aircraft typically don't need - // dynamic notch filtering (designed for multirotor motor noise) - gyroConfigMutable()->dynamicGyroNotchEnabled = 0; -#endif }
Evidence
The settings source-of-truth sets dynamic notch enabled by default when dynamic filters are compiled. This target compiles dynamic filters (via common.h) and no longer overrides the setting in targetConfiguration(), so after reset it remains enabled. When enabled, gyro.c executes the dynamic analysis and applies the notch filters in the hot gyro path.
src/main/fc/settings.yaml[284-296]
src/main/target/common.h[60-77]
src/main/fc/config.c[280-307]
src/main/target/BLUEBERRYF435WING/config.c[30-41]
src/main/flight/dynamic_gyro_notch.c[35-60]
src/main/sensors/gyro.c[470-534]
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution ## Issue description `dynamic_gyro_notch_enabled` defaults to ON (when `USE_DYNAMIC_FILTERS` is enabled). This PR removed the BLUEBERRYF435WING-specific override that disabled it in `targetConfiguration()`, so a config reset will now enable dynamic notch on this target. ## Issue Context Dynamic notch adds extra work in the gyro hot path. If BLUEBERRYF435WING should prioritize CPU headroom (or preserve previous default behavior), it needs an explicit override. ## Fix Focus Areas - Re-introduce a `#ifdef USE_DYNAMIC_FILTERS` override setting `gyroConfigMutable()->dynamicGyroNotchEnabled = 0;` in the target configuration. - Re-add the required include (`sensors/gyro.h`) only if needed by the override. ## Fix Focus Areas (code pointers) - src/main/target/BLUEBERRYF435WING/config.c[30-41]
i Copy this prompt and use it to remediate the issue with your preferred AI generation tools
i The new review experience is currently in Beta. Learn more
No description provided.