Skip to content

Fix some IMU configurations #792

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

haslinghuis
Copy link
Member

@haslinghuis haslinghuis commented May 27, 2025

  • First cut of adding GYRO_COUNT and DEFAULT_GYRO_ENABLED define
  • Needed for Add 3+ IMU support betaflight#14383
  • EDIT: GYRO_COUNT and DEFAULT_GYRO_ENABLED are now handled in firmware
  • EDIT2: only removes default defines and fix some targets

Summary by CodeRabbit

  • New Features
    • Added new configuration options for gyro count and default enabled gyros on select boards.
  • Chores
    • Updated formatting and organization of configuration settings for improved clarity.
    • Removed redundant or unnecessary macro definitions from multiple board configurations.

@haslinghuis haslinghuis self-assigned this May 27, 2025
Copy link

coderabbitai bot commented May 27, 2025

Walkthrough

This set of changes updates multiple board configuration header files. The primary modifications include removing, reformatting, or relocating the DEFAULT_GYRO_TO_USE macro, removing GYRO_2_SPI_INSTANCE macros from some configs, and adding new gyro-related macros in one config. No functional logic or control flow is altered.

Changes

File(s) Change Summary
configs/FLYWOOH743PRO/config.h, configs/JHEF722HD/config.h Reformatted DEFAULT_GYRO_TO_USE macro for spacing/alignment; in JHEF722HD, also moved its location.
configs/CHONKERH735/config.h,
configs/EMAX_BABYHAWK_II_HD/config.h,
configs/HGLRCF405/config.h,
configs/HGLRCF745/config.h,
configs/MATEKF722HD/config.h,
configs/MATEKH743/config.h,
configs/SAKURAH743/config.h,
configs/SPRACINGH7NANO/config.h,
configs/SPRACINGH7ZERO/config.h,
configs/TAKERG4AIO/config.h,
configs/TALONF4V2/config.h,
configs/TBS_LUCID_H7/config.h,
configs/TMOTORH743/config.h
Removed DEFAULT_GYRO_TO_USE macro definition.
configs/FLYWOOF411/config.h,
configs/MERAKRCF722/config.h
Removed GYRO_2_SPI_INSTANCE macro definition.
configs/WIZZF7HD/config.h Added GYRO_COUNT and DEFAULT_GYRO_ENABLED macro definitions.
configs/NEUTRONRCF407/config.h Added a blank line after the USE_GYRO macro.

Sequence Diagram(s)

Not applicable: changes are limited to configuration macro definitions and formatting.

Possibly related PRs

  • Fix DAKEFPVH743PRO target #795: Directly modifies the DEFAULT_GYRO_TO_USE macro in configs/FLYWOOH743PRO/config.h, indicating a strong connection to the changes in this PR.

Suggested reviewers

  • nerdCopter
  • ot0tot

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 19501e6 and d4fb425.

📒 Files selected for processing (3)
  • configs/FLYWOOH743PRO/config.h (1 hunks)
  • configs/JHEF722HD/config.h (1 hunks)
  • configs/NEUTRONRCF407/config.h (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • configs/NEUTRONRCF407/config.h
  • configs/JHEF722HD/config.h
🚧 Files skipped from review as they are similar to previous changes (1)
  • configs/FLYWOOH743PRO/config.h
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or `` to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (6)
configs/GEPRCF745_BT_HD/config.h (1)

123-123: Document and guard the new GYRO_COUNT macro
While introducing GYRO_COUNT is helpful for multi-IMU support, it’s best practice to (1) wrap it in an #ifndef/#endif to avoid accidental redefinition and (2) add a brief comment explaining its purpose. For example:

-#define GYRO_COUNT 2
+#ifndef GYRO_COUNT
+// Number of gyroscopes enabled on this board (supports multi-IMU setups)
+#define GYRO_COUNT 2
+#endif

Would you like me to apply this pattern across all board configs and update any related documentation?

configs/JBF7_DJI/config.h (1)

104-104: Explicitly define the number of gyros
Good addition: GYRO_COUNT now signals two-IMU support in this board config. Consider adding a brief comment (e.g., Doxygen) above the macro to document its purpose and how it’s consumed by the IMU initialization code.

configs/SKYSTARSH7HD/config.h (1)

133-133: Approve GYRO_COUNT macro addition

The #define GYRO_COUNT 2 correctly specifies the dual-gyro setup for this board. Please ensure that all gyro-related loops and configurations reference this macro rather than hardcoded values to maintain consistency. As a minor enhancement, consider adding an inline comment to describe its purpose for future maintainers, e.g.:

// Number of gyroscope sensors present on SKYSTARSH7HD

configs/IFLIGHT_F405_TWING/config.h (1)

95-97: Add a descriptive comment for clarity
To improve maintainability, consider adding a brief comment above the macro to explain its purpose. For example:

/* Number of gyroscopes connected on this board for multi-IMU support */
#define GYRO_COUNT 2
configs/NEUTRONRCF407/config.h (1)

103-105: Add inline documentation for GYRO_COUNT
Consider adding a brief comment above the macro to explain its purpose and units, for improved maintainability. For example:

-#define GYRO_COUNT 2
+#define GYRO_COUNT 2  // number of gyroscope sensors (IMUs) supported by this board
configs/NBD_INFINITYAIOV2PRO/config.h (1)

87-87:

❓ Verification inconclusive

Document and verify the new GYRO_COUNT macro.

Please add an inline comment to clarify that GYRO_COUNT specifies the number of gyros for multi-IMU support:

+#define GYRO_COUNT 2  // Total number of gyroscope sensors present (for dual-IMU configurations)
-#define GYRO_COUNT 2

Additionally, ensure that all code in the main Betaflight repository correctly references this new macro. You can verify usage with:


🏁 Script executed:

#!/bin/bash
# Search for references to GYRO_COUNT in the codebase
rg -n 'GYRO_COUNT' -A2

Length of output: 6358


Document and Integrate GYRO_COUNT Macro

– configs/NBD_INFINITYAIOV2PRO/config.h:87

-#define GYRO_COUNT 2
+#define GYRO_COUNT 2  // Total number of gyroscope sensors present (dual-IMU support)

– We ran rg -n 'GYRO_COUNT' -A2 and only found these macro definitions in board configs—not any references in the core firmware. Please verify that all gyro-related code (array sizes, initialization loops, sensor count checks in IMU/gyro drivers) uses GYRO_COUNT instead of hard-coded values (e.g. replace any “2” with GYRO_COUNT where appropriate).

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4136fa2 and 1549b13.

📒 Files selected for processing (34)
  • configs/AOCODARCH7DUAL/config.h (1 hunks)
  • configs/CCRCF722D/config.h (1 hunks)
  • configs/CLRACINGF7/config.h (1 hunks)
  • configs/DAKEFPVH743/config.h (1 hunks)
  • configs/DARWINH7DUAL/config.h (1 hunks)
  • configs/DFR_F722_DUAL_HD/config.h (1 hunks)
  • configs/EXF722DUAL/config.h (1 hunks)
  • configs/FLYWOOH743PRO/config.h (1 hunks)
  • configs/GEPRCF722_BT_HD/config.h (1 hunks)
  • configs/GEPRCF745_BT_HD/config.h (1 hunks)
  • configs/HAKRCF722V2/config.h (1 hunks)
  • configs/IFLIGHT_F405_TWING/config.h (1 hunks)
  • configs/IFLIGHT_F722_TWING/config.h (1 hunks)
  • configs/IFLIGHT_H743_AIO_V2/config.h (1 hunks)
  • configs/IFLIGHT_H7_TWING/config.h (1 hunks)
  • configs/JBF7/config.h (1 hunks)
  • configs/JBF7_DJI/config.h (1 hunks)
  • configs/JHEF722HD/config.h (1 hunks)
  • configs/JHEH743_HD/config.h (1 hunks)
  • configs/KONEXH743/config.h (1 hunks)
  • configs/MAMBAH743_2022B/config.h (1 hunks)
  • configs/NBD_CRICKETF7V2/config.h (1 hunks)
  • configs/NBD_GALAXYAIO255/config.h (1 hunks)
  • configs/NBD_INFINITYAIOV2PRO/config.h (1 hunks)
  • configs/NEUTRONRCF407/config.h (1 hunks)
  • configs/NEUTRONRCH743AIO/config.h (1 hunks)
  • configs/NEUTRONRCH7BT/config.h (1 hunks)
  • configs/SKYSTARSH7HD/config.h (1 hunks)
  • configs/SPRACINGF7DUAL/config.h (1 hunks)
  • configs/SPRACINGH7EF/config.h (1 hunks)
  • configs/SPRACINGH7EXTREME/config.h (1 hunks)
  • configs/SUB250REDFOXF722AIO/config.h (1 hunks)
  • configs/TALONF7FUSION/config.h (1 hunks)
  • configs/WIZZF7HD/config.h (1 hunks)
🔇 Additional comments (30)
configs/HAKRCF722V2/config.h (1)

102-102: Declare number of gyroscopes for dual-IMU support
The added #define GYRO_COUNT 2 explicitly sets up two gyros, aligning with DEFAULT_GYRO_TO_USE GYRO_CONFIG_USE_GYRO_BOTH. Verify that its placement and naming match other board configs for consistency and seamless multi-IMU integration.

configs/NBD_GALAXYAIO255/config.h (1)

102-102: New macro definition looks good.

The GYRO_COUNT macro is correctly defined alongside DEFAULT_GYRO_TO_USE and aligns with the intended support for two gyros on this board. Ensure that downstream code and documentation reference this constant where needed.

configs/JBF7/config.h (1)

104-104: Explicitly set GYRO_COUNT for dual-IMU support.

This addition correctly matches the two gyro EXTI/CS definitions and brings this board in line with the other configs in this PR.

configs/IFLIGHT_F405_TWING/config.h (1)

95-97: Explicitly set gyro count for dual-IMU support
The new #define GYRO_COUNT 2 correctly specifies that this board uses two gyroscopes, aligning with DEFAULT_GYRO_TO_USE GYRO_CONFIG_USE_GYRO_BOTH and the intended multi-IMU configuration.

configs/NEUTRONRCF407/config.h (1)

103-105:

✅ Verification successful

Verify consistency of GYRO_COUNT with other board configs
You added #define GYRO_COUNT 2 to explicitly declare the number of gyros for NEUTRONRCF407. Please ensure that:

  • All other board configuration headers that support two IMUs include the same GYRO_COUNT 2 define.
  • The sensor initialization and build scripts consume this macro correctly (e.g., adjust array sizes, loops, conditional compilation).

You can run the following to cross-check across configs/ directory:


🏁 Script executed:

rg -n "#define GYRO_COUNT" -R configs/

Length of output: 445


🏁 Script executed:

#!/bin/bash
# Search for all GYRO_COUNT definitions across board config headers
rg -n "#define GYRO_COUNT" configs/

Length of output: 1944


GYRO_COUNT Definition Matches Other Dual-IMU Boards
The #define GYRO_COUNT 2 in configs/NEUTRONRCF407/config.h is now consistent with all other board configs that support two gyros.

No further changes required.

configs/AOCODARCH7DUAL/config.h (1)

130-130: Explicitly define gyro count for dual IMU support

The new GYRO_COUNT macro is correctly set to 2, making the dual-gyro configuration explicit and consistent with other dual-IMU board headers.

configs/CCRCF722D/config.h (1)

99-99: Explicitly define gyro count for dual IMU support

The GYRO_COUNT macro has been correctly introduced with a value of 2. This explicit declaration aligns with the board’s dual-gyro setup and matches other configuration headers.

configs/DAKEFPVH743/config.h (1)

138-138: Explicitly define gyro count for dual IMU support

Adding #define GYRO_COUNT 2 here makes the dual-gyro arrangement explicit and consistent across all dual-IMU board configs.

configs/IFLIGHT_F722_TWING/config.h (1)

105-105: Explicitly define gyro count for dual IMU support

The GYRO_COUNT macro is correctly set to 2, standardizing the dual-gyro declaration in this board’s header.

configs/SPRACINGF7DUAL/config.h (1)

115-115: Explicitly define gyro count for dual IMU support

Introducing GYRO_COUNT with a value of 2 here clearly documents the dual-gyro configuration and keeps it uniform with other headers.

configs/NEUTRONRCH7BT/config.h (1)

131-131: Add GYRO_COUNT macro for dual-gyro support
The new #define GYRO_COUNT 2 explicitly declares two gyros alongside DEFAULT_GYRO_TO_USE. Placement, value, and formatting align with other board configs.

configs/SUB250REDFOXF722AIO/config.h (1)

102-102: Add GYRO_COUNT macro for dual-gyro support
This #define GYRO_COUNT 2 correctly follows DEFAULT_GYRO_TO_USE, making the board’s dual-IMU setup explicit. No issues spotted.

configs/WIZZF7HD/config.h (1)

107-107: Add GYRO_COUNT macro for dual-gyro support
Defining GYRO_COUNT 2 immediately after DEFAULT_GYRO_TO_USE is consistent with the intended dual-gyro configuration. Looks good.

configs/IFLIGHT_H7_TWING/config.h (1)

113-113: Add GYRO_COUNT macro for dual-gyro support
The addition of #define GYRO_COUNT 2 correctly specifies two gyros and mirrors other board headers. Approved.

configs/JHEF722HD/config.h (1)

101-101: Add GYRO_COUNT macro for dual-gyro support
Introducing GYRO_COUNT 2 here makes the dual-IMU count explicit and aligns with the broader PR. No concerns.

configs/DARWINH7DUAL/config.h (1)

116-116: Explicitly declare dual gyro count
The new macro #define GYRO_COUNT 2 clearly specifies two gyroscopes for this board, aligning with the dual-IMU support added in Betaflight main.

configs/JHEH743_HD/config.h (1)

135-135: Define GYRO_COUNT for dual-IMU configuration
Adding #define GYRO_COUNT 2 makes the number of gyros explicit and matches the multi-IMU setup planned upstream.

configs/MAMBAH743_2022B/config.h (1)

136-136: Add GYRO_COUNT macro to specify two gyros
This define sets the gyro count to 2, ensuring consistency with the dual-sensor configurations across boards.

configs/SPRACINGH7EXTREME/config.h (1)

239-239: Introduce GYRO_COUNT for two gyroscopes
The macro explicitly declares GYRO_COUNT 2, supporting the intended dual-IMU feature set without altering existing logic.

configs/CLRACINGF7/config.h (1)

127-127: Explicitly set GYRO_COUNT to 2
Defining GYRO_COUNT makes the number of gyroscopes clear and standardizes this across all dual-IMU board configs.

configs/IFLIGHT_H743_AIO_V2/config.h (1)

116-116: Explicitly define number of gyroscopes
Adding #define GYRO_COUNT 2 clearly documents dual-gyro support for this board and aligns with the PR’s objective of standardizing multi-IMU configurations.

configs/KONEXH743/config.h (1)

159-159: Explicitly define number of gyroscopes
The inserted #define GYRO_COUNT 2 after DEFAULT_GYRO_TO_USE maintains consistency with other board configs and unambiguously declares dual-gyro support.

configs/FLYWOOH743PRO/config.h (1)

131-131: Explicitly declare dual-gyro support
The addition of #define GYRO_COUNT 2 right after DEFAULT_GYRO_TO_USE is consistent with the rest of the PR and makes the gyro count explicit.

configs/NBD_CRICKETF7V2/config.h (1)

78-78: Document number of gyroscopes
Inserting #define GYRO_COUNT 2 explicitly specifies two gyros for this board and aligns with other configurations in the PR.

configs/NEUTRONRCH743AIO/config.h (1)

126-126: Explicit GYRO_COUNT definition
Adding #define GYRO_COUNT 2 enhances clarity around supported IMUs and is in line with the uniform updates across board configs.

configs/TALONF7FUSION/config.h (1)

95-95: Explicitly define GYRO_COUNT
Good addition to specify the number of gyros for this dual-gyro board. Improves clarity and ensures downstream code can size arrays and loops correctly.

configs/SPRACINGH7EF/config.h (1)

295-295: Explicitly define GYRO_COUNT
This macro clearly indicates two gyros are present on the SPRACINGH7EF. Matches the existing USE_MULTI_GYRO setting and will help centralize gyro-count logic.

configs/DFR_F722_DUAL_HD/config.h (1)

107-107: Explicitly define GYRO_COUNT
Adds a clear marker for two gyros on the DFR_F722_DUAL_HD board. This aligns with the physical hardware and aids maintainability.

configs/EXF722DUAL/config.h (1)

104-104: Explicitly define GYRO_COUNT
Good to have the number of gyros defined consistently. This will simplify multi-gyro support in the core firmware.

configs/GEPRCF722_BT_HD/config.h (1)

102-102:

❓ Verification inconclusive

Add GYRO_COUNT for multi-IMU support – verify consistency

The new #define GYRO_COUNT 2 explicitly declares the number of gyroscopes and aligns with the intent to support dual-IMU configurations. Please ensure that:

  1. All other board config headers also define GYRO_COUNT.
  2. Downstream code (array allocations, loops, IMU init paths) is updated to consume this macro.

Run this script to detect any config headers missing GYRO_COUNT:


🏁 Script executed:

#!/bin/bash
# Description: Find config.h files that lack the GYRO_COUNT definition
rg -L '#define GYRO_COUNT' configs

Length of output: 1812


All board config headers define GYRO_COUNT – verify downstream IMU usage

I ran the provided script to look for any config.h missing the #define GYRO_COUNT and found none. Next, please review the IMU-related code to ensure it consumes this new macro:

  • Array allocations for gyro data use GYRO_COUNT rather than a hard-coded value.
  • Initialization loops and IMU setup paths iterate based on GYRO_COUNT.

@haslinghuis haslinghuis changed the title Add GYRO_COUNT Add GYRO_COUNT and DEFAULT_GYRO_ENABLED May 27, 2025
@haslinghuis haslinghuis changed the title Add GYRO_COUNT and DEFAULT_GYRO_ENABLED Add Add 3+ IMU support (GYRO_COUNT and DEFAULT_GYRO_ENABLED) May 27, 2025
@haslinghuis haslinghuis changed the title Add Add 3+ IMU support (GYRO_COUNT and DEFAULT_GYRO_ENABLED) Add 3+ IMU support (GYRO_COUNT and DEFAULT_GYRO_ENABLED) May 27, 2025
@Quick-Flash
Copy link

Just need to make sure it covers all FC that have #define GYRO_2_XXXXX Hopefully this is all of them.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🔭 Outside diff range comments (1)
configs/NEUTRONRCF745VTX/config.h (1)

153-153: 💡 Verification agent

🧩 Analysis chain

Verify asymmetric gyro alignment configuration.

The configuration defines GYRO_1_ALIGN CW270_DEG but lacks a corresponding GYRO_2_ALIGN definition. Please verify if GYRO_2 requires a specific alignment or if it uses the default orientation.


🏁 Script executed:

#!/bin/bash
# Description: Check if GYRO_2_ALIGN is defined elsewhere or if other dual-gyro configs have asymmetric alignment
# Expected: Understand if this is intentional or missing

echo "Checking for any GYRO_2_ALIGN in current config:"
rg "GYRO_2_ALIGN" configs/NEUTRONRCF745VTX/

echo -e "\nChecking other dual-gyro configs for GYRO_2_ALIGN patterns:"
rg -A 1 -B 1 "GYRO_2_ALIGN" configs/ | head -10

Length of output: 788


Add missing GYRO_2_ALIGN in NEUTRONRCF745VTX/config.h

The config defines GYRO_1_ALIGN CW270_DEG but no GYRO_2_ALIGN, whereas all other dual-gyro boards explicitly set both. Please add an explicit alignment for gyro 2 to avoid relying on undocumented defaults.

• File: configs/NEUTRONRCF745VTX/config.h
• Location: immediately after the #define GYRO_1_ALIGN CW270_DEG line

Suggested snippet:

 #define GYRO_1_ALIGN CW270_DEG
+#define GYRO_2_ALIGN CW0_DEG   // or change to the correct rotation if gyro 2 is mounted differently
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 13b354a and ead18f8.

📒 Files selected for processing (107)
  • configs/AG3XF4/config.h (1 hunks)
  • configs/AG3XF7/config.h (1 hunks)
  • configs/AIRBOTF4SD/config.h (1 hunks)
  • configs/AIRBOTF4V2/config.h (1 hunks)
  • configs/AIRBOTF7/config.h (1 hunks)
  • configs/AIRF7/config.h (1 hunks)
  • configs/ALIENFLIGHTNGF7_DUAL/config.h (1 hunks)
  • configs/AOCODARCF7DUAL/config.h (1 hunks)
  • configs/AOCODARCH7DUAL/config.h (1 hunks)
  • configs/APEXF7/config.h (1 hunks)
  • configs/APEXF72023/config.h (1 hunks)
  • configs/BAYCK_DOLPHIN/config.h (1 hunks)
  • configs/BEEROTORF4/config.h (1 hunks)
  • configs/BETAFPVF722/config.h (1 hunks)
  • configs/BETAFPVH743/config.h (1 hunks)
  • configs/CCRCF722D/config.h (1 hunks)
  • configs/CHONKERH735/config.h (1 hunks)
  • configs/CLRACINGF4/config.h (1 hunks)
  • configs/CLRACINGF4V2/config.h (1 hunks)
  • configs/CLRACINGF7/config.h (1 hunks)
  • configs/DAKEFPVH743/config.h (1 hunks)
  • configs/DALRCF722DUAL/config.h (1 hunks)
  • configs/DARWINH7DUAL/config.h (1 hunks)
  • configs/DFR_F722_DUAL_HD/config.h (1 hunks)
  • configs/DREAMWORKSF722/config.h (1 hunks)
  • configs/DRONEERH743DUAL/config.h (1 hunks)
  • configs/DYSF4PRO/config.h (1 hunks)
  • configs/ELINF405/config.h (1 hunks)
  • configs/ELINF722/config.h (1 hunks)
  • configs/EMAX_BABYHAWK_II_HD/config.h (1 hunks)
  • configs/EMAX_TINYHAWK_F411RX/config.h (1 hunks)
  • configs/EXF722DUAL/config.h (1 hunks)
  • configs/EXUAVF4PRO/config.h (1 hunks)
  • configs/FLYCOLORF7/config.h (1 hunks)
  • configs/FLYCOLORF7MINI/config.h (1 hunks)
  • configs/FLYCOLORF7V2/config.h (1 hunks)
  • configs/FLYFISHRCF405/config.h (1 hunks)
  • configs/FLYWOOF405/config.h (1 hunks)
  • configs/FLYWOOF405S_AIO/config.h (1 hunks)
  • configs/FLYWOOF411/config.h (1 hunks)
  • configs/FLYWOOF411EVO_HD/config.h (1 hunks)
  • configs/FLYWOOF411V2/config.h (1 hunks)
  • configs/FLYWOOF722PRO/config.h (1 hunks)
  • configs/FLYWOOF722PROV2/config.h (1 hunks)
  • configs/FLYWOOF745/config.h (1 hunks)
  • configs/FLYWOOF745HEX/config.h (1 hunks)
  • configs/FLYWOOF7DUAL/config.h (1 hunks)
  • configs/FLYWOOH743PRO/config.h (1 hunks)
  • configs/FOXEERF722DUAL/config.h (1 hunks)
  • configs/FPVM_BETAFLIGHTF7/config.h (1 hunks)
  • configs/GEPRCF722/config.h (1 hunks)
  • configs/GEPRCF722_BT_HD/config.h (1 hunks)
  • configs/GEPRCF745_BT_HD/config.h (1 hunks)
  • configs/GEPRC_TAKER_H743/config.h (1 hunks)
  • configs/HAKRCF722D/config.h (1 hunks)
  • configs/HAKRCF722V2/config.h (1 hunks)
  • configs/HAKRCF7230D/config.h (1 hunks)
  • configs/HDZERO_HALO/config.h (1 hunks)
  • configs/HGLRCF405/config.h (1 hunks)
  • configs/HGLRCF405AS/config.h (1 hunks)
  • configs/HGLRCF411/config.h (1 hunks)
  • configs/HGLRCF745/config.h (1 hunks)
  • configs/HIFIONRCF7/config.h (1 hunks)
  • configs/HOBBYWING_XROTORF4G3/config.h (1 hunks)
  • configs/HOBBYWING_XROTORF7CONV/config.h (1 hunks)
  • configs/IFLIGHT_F405_TWING/config.h (1 hunks)
  • configs/IFLIGHT_F722_TWING/config.h (1 hunks)
  • configs/IFLIGHT_F745_AIO_V2/config.h (1 hunks)
  • configs/IFLIGHT_H743_AIO_V2/config.h (1 hunks)
  • configs/IFLIGHT_H7_TWING/config.h (1 hunks)
  • configs/JBF7/config.h (1 hunks)
  • configs/JBF7_DJI/config.h (1 hunks)
  • configs/JHEF411/config.h (1 hunks)
  • configs/JHEF722HD/config.h (1 hunks)
  • configs/JHEF7DUAL/config.h (1 hunks)
  • configs/JHEH743_AIO/config.h (1 hunks)
  • configs/JHEH743_HD/config.h (1 hunks)
  • configs/KAKUTEF4V2/config.h (1 hunks)
  • configs/KAKUTEF7/config.h (1 hunks)
  • configs/KAKUTEF7HDV/config.h (1 hunks)
  • configs/KAKUTEF7MINI/config.h (1 hunks)
  • configs/KONEXH743/config.h (1 hunks)
  • configs/LUXF4OSD/config.h (1 hunks)
  • configs/MAMBAG4/config.h (1 hunks)
  • configs/MAMBAH743/config.h (1 hunks)
  • configs/MAMBAH743_2022B/config.h (1 hunks)
  • configs/MATEKF411RX/config.h (1 hunks)
  • configs/MATEKF722/config.h (1 hunks)
  • configs/MATEKF722HD/config.h (1 hunks)
  • configs/MATEKF722MINI/config.h (1 hunks)
  • configs/MATEKF722SE/config.h (1 hunks)
  • configs/MATEKH743/config.h (1 hunks)
  • configs/MERAKRCF405/config.h (1 hunks)
  • configs/MERAKRCF722/config.h (1 hunks)
  • configs/MINI_H743_HD/config.h (1 hunks)
  • configs/MODULARF4/config.h (1 hunks)
  • configs/NBD_CRICKETF7V2/config.h (1 hunks)
  • configs/NBD_GALAXYAIO255/config.h (1 hunks)
  • configs/NBD_INFINITY200RS/config.h (1 hunks)
  • configs/NBD_INFINITYAIOV2PRO/config.h (1 hunks)
  • configs/NEUTRONRCF407/config.h (1 hunks)
  • configs/NEUTRONRCF745/config.h (1 hunks)
  • configs/NEUTRONRCF745VTX/config.h (1 hunks)
  • configs/NEUTRONRCF7AIO/config.h (1 hunks)
  • configs/NEUTRONRCH743AIO/config.h (1 hunks)
  • configs/NEUTRONRCH7BT/config.h (1 hunks)
  • configs/OMNIBUSF4/config.h (1 hunks)
⛔ Files not processed due to max files limit (34)
  • configs/OMNIBUSF4FW/config.h
  • configs/OMNIBUSF4NANOV7/config.h
  • configs/OMNIBUSF4SD/config.h
  • configs/OMNIBUSF4V6/config.h
  • configs/OMNIBUSF7/config.h
  • configs/OMNIBUSF7NANOV7/config.h
  • configs/OMNIBUSF7V2/config.h
  • configs/OMNINXT4/config.h
  • configs/OMNINXT7/config.h
  • configs/PYRODRONEF7/config.h
  • configs/SKYSTARSH7HD/config.h
  • configs/SPEDIXF4/config.h
  • configs/SPEEDYBEEF7V3/config.h
  • configs/SPRACINGF7DUAL/config.h
  • configs/SPRACINGH7EF/config.h
  • configs/SPRACINGH7EXTREME/config.h
  • configs/SPRACINGH7NANO/config.h
  • configs/SPRACINGH7ZERO/config.h
  • configs/STELLARH7DEV/config.h
  • configs/SUB250REDFOXF722AIO/config.h
  • configs/SYNERGYF4/config.h
  • configs/TALONF7FUSION/config.h
  • configs/TBS_LUCID_H7/config.h
  • configs/TCMMF7/config.h
  • configs/TMH7/config.h
  • configs/TMOTORF4/config.h
  • configs/TMOTORH743/config.h
  • configs/TMVELOXF7/config.h
  • configs/TRANSTECF7/config.h
  • configs/VGOODF722DUAL/config.h
  • configs/VGOODRCF4/config.h
  • configs/WDIYH743/config.h
  • configs/WIZZF7HD/config.h
  • configs/XRACERF4/config.h
✅ Files skipped from review due to trivial changes (70)
  • configs/AIRBOTF4V2/config.h
  • configs/CLRACINGF4V2/config.h
  • configs/JHEF7DUAL/config.h
  • configs/FPVM_BETAFLIGHTF7/config.h
  • configs/JHEH743_AIO/config.h
  • configs/MINI_H743_HD/config.h
  • configs/HGLRCF411/config.h
  • configs/FLYCOLORF7/config.h
  • configs/FLYWOOF722PRO/config.h
  • configs/DALRCF722DUAL/config.h
  • configs/FLYFISHRCF405/config.h
  • configs/FLYCOLORF7V2/config.h
  • configs/GEPRCF722/config.h
  • configs/IFLIGHT_F745_AIO_V2/config.h
  • configs/GEPRC_TAKER_H743/config.h
  • configs/CLRACINGF4/config.h
  • configs/MATEKF722HD/config.h
  • configs/HOBBYWING_XROTORF7CONV/config.h
  • configs/HOBBYWING_XROTORF4G3/config.h
  • configs/BETAFPVF722/config.h
  • configs/FLYWOOF405S_AIO/config.h
  • configs/LUXF4OSD/config.h
  • configs/HIFIONRCF7/config.h
  • configs/HAKRCF722D/config.h
  • configs/ELINF405/config.h
  • configs/APEXF7/config.h
  • configs/ALIENFLIGHTNGF7_DUAL/config.h
  • configs/MODULARF4/config.h
  • configs/CHONKERH735/config.h
  • configs/MATEKF722MINI/config.h
  • configs/MATEKH743/config.h
  • configs/FLYCOLORF7MINI/config.h
  • configs/FLYWOOF405/config.h
  • configs/MATEKF722/config.h
  • configs/FLYWOOF745HEX/config.h
  • configs/HAKRCF7230D/config.h
  • configs/HGLRCF745/config.h
  • configs/FLYWOOF722PROV2/config.h
  • configs/NEUTRONRCF745/config.h
  • configs/AIRBOTF7/config.h
  • configs/JHEF411/config.h
  • configs/FLYWOOF7DUAL/config.h
  • configs/APEXF72023/config.h
  • configs/AIRF7/config.h
  • configs/AG3XF7/config.h
  • configs/BETAFPVH743/config.h
  • configs/EMAX_TINYHAWK_F411RX/config.h
  • configs/BAYCK_DOLPHIN/config.h
  • configs/DREAMWORKSF722/config.h
  • configs/NBD_INFINITY200RS/config.h
  • configs/MATEKF411RX/config.h
  • configs/KAKUTEF4V2/config.h
  • configs/HDZERO_HALO/config.h
  • configs/MAMBAH743/config.h
  • configs/FLYWOOF745/config.h
  • configs/AG3XF4/config.h
  • configs/DYSF4PRO/config.h
  • configs/MERAKRCF405/config.h
  • configs/HGLRCF405/config.h
  • configs/KAKUTEF7/config.h
  • configs/FLYWOOF411V2/config.h
  • configs/FOXEERF722DUAL/config.h
  • configs/MAMBAG4/config.h
  • configs/KAKUTEF7HDV/config.h
  • configs/NEUTRONRCF7AIO/config.h
  • configs/ELINF722/config.h
  • configs/OMNIBUSF4/config.h
  • configs/AIRBOTF4SD/config.h
  • configs/DRONEERH743DUAL/config.h
  • configs/EMAX_BABYHAWK_II_HD/config.h
🚧 Files skipped from review as they are similar to previous changes (28)
  • configs/DARWINH7DUAL/config.h
  • configs/GEPRCF745_BT_HD/config.h
  • configs/NBD_INFINITYAIOV2PRO/config.h
  • configs/NEUTRONRCH743AIO/config.h
  • configs/JBF7/config.h
  • configs/IFLIGHT_H7_TWING/config.h
  • configs/FLYWOOH743PRO/config.h
  • configs/MAMBAH743_2022B/config.h
  • configs/AOCODARCF7DUAL/config.h
  • configs/NEUTRONRCF407/config.h
  • configs/IFLIGHT_H743_AIO_V2/config.h
  • configs/IFLIGHT_F405_TWING/config.h
  • configs/KONEXH743/config.h
  • configs/CLRACINGF7/config.h
  • configs/JHEH743_HD/config.h
  • configs/JHEF722HD/config.h
  • configs/NEUTRONRCH7BT/config.h
  • configs/GEPRCF722_BT_HD/config.h
  • configs/DFR_F722_DUAL_HD/config.h
  • configs/DAKEFPVH743/config.h
  • configs/AOCODARCH7DUAL/config.h
  • configs/NBD_GALAXYAIO255/config.h
  • configs/NBD_CRICKETF7V2/config.h
  • configs/JBF7_DJI/config.h
  • configs/IFLIGHT_F722_TWING/config.h
  • configs/EXF722DUAL/config.h
  • configs/HAKRCF722V2/config.h
  • configs/CCRCF722D/config.h
🔇 Additional comments (7)
configs/HGLRCF405AS/config.h (2)

30-30: LGTM! Addition is correct and consistent.

The GYRO_COUNT 2 definition is properly placed and consistent with the existing dual-gyro configuration evidenced by the GYRO_1 and GYRO_2 definitions throughout the file.


30-30:

✅ Verification successful

Verify if DEFAULT_GYRO_ENABLED should also be added.

According to the AI summary, most board configurations are receiving both GYRO_COUNT and DEFAULT_GYRO_ENABLED defines. This board has GYRO_2 configurations (lines 116), so it should be covered completely per Quick-Flash's comment about ensuring all boards with GYRO_2_XXXXX definitions are included.


🏁 Script executed:

#!/bin/bash
# Description: Check if other board configs with GYRO_2 configurations also include DEFAULT_GYRO_ENABLED
# Expected: Most configs with GYRO_2 should have both GYRO_COUNT and DEFAULT_GYRO_ENABLED

# Find all config files that have GYRO_2 definitions
echo "=== Boards with GYRO_2 configurations ==="
rg -l "GYRO_2_" configs/

echo -e "\n=== Check which have both GYRO_COUNT and DEFAULT_GYRO_ENABLED ==="
for file in $(rg -l "GYRO_2_" configs/); do
  echo "--- $file ---"
  echo -n "GYRO_COUNT: "
  if grep -q "GYRO_COUNT" "$file"; then echo ""; else echo ""; fi
  echo -n "DEFAULT_GYRO_ENABLED: "
  if grep -q "DEFAULT_GYRO_ENABLED" "$file"; then echo ""; else echo ""; fi
  echo
done

Length of output: 66297


DEFAULT_GYRO_ENABLED already defined in configs/HGLRCF405AS/config.h
Verified that this file contains both

  • #define GYRO_COUNT 2
  • #define DEFAULT_GYRO_ENABLED …

No further changes required.

configs/MERAKRCF722/config.h (1)

32-32: LGTM! GYRO_COUNT addition is correct and consistent.

The addition of GYRO_COUNT 2 is appropriate and aligns with the existing GYRO_2_SPI_INSTANCE definition at line 101, confirming this board supports dual gyroscopes.

configs/FLYWOOF411EVO_HD/config.h (1)

32-32: LGTM! The GYRO_COUNT definition is correct.

The addition of #define GYRO_COUNT 2 is appropriate and consistent with the existing dual gyro configuration (GYRO_1 and GYRO_2 definitions on lines 97-99).

configs/MATEKF722SE/config.h (1)

33-33: LGTM: GYRO_COUNT addition is consistent with existing dual gyro configuration.

The addition of GYRO_COUNT 2 correctly reflects that this board has dual gyro support, as evidenced by the existing GYRO_1_* and GYRO_2_* definitions throughout the file.

configs/NEUTRONRCF745VTX/config.h (1)

32-32:

❓ Verification inconclusive

Verify completeness of dual IMU implementation.

The GYRO_COUNT 2 definition is correct for this board. However, according to the PR objectives and AI summary, other board configurations received both GYRO_COUNT and DEFAULT_GYRO_ENABLED definitions. This config appears to be missing the DEFAULT_GYRO_ENABLED definition.


🏁 Script executed:

#!/bin/bash
# Description: Check if DEFAULT_GYRO_ENABLED is defined elsewhere in this config or verify if it should be added
# Expected: Find if DEFAULT_GYRO_ENABLED is missing and compare with other board configs

echo "Checking for DEFAULT_GYRO_ENABLED in current config:"
rg "DEFAULT_GYRO_ENABLED" configs/NEUTRONRCF745VTX/

echo -e "\nChecking other board configs that got both defines in this PR:"
rg -l "GYRO_COUNT.*2" configs/ | head -5 | xargs -I {} bash -c 'echo "=== {} ==="; rg "DEFAULT_GYRO_ENABLED" {}'

Length of output: 733


🏁 Script executed:

#!/bin/bash
# Verify presence of gyro alignment definitions in this config
echo "Checking for GYRO_1_ALIGN and GYRO_2_ALIGN in configs/NEUTRONRCF745VTX/config.h"
rg "GYRO_1_ALIGN" configs/NEUTRONRCF745VTX/config.h || echo "GYRO_1_ALIGN not found"
rg "GYRO_2_ALIGN" configs/NEUTRONRCF745VTX/config.h || echo "GYRO_2_ALIGN not found"

Length of output: 358


Add missing dual-IMU definitions

The GYRO_COUNT 2 is correct, but this board config still needs:

  • A DEFAULT_GYRO_ENABLED definition to match other dual-IMU boards
  • A GYRO_2_ALIGN definition alongside the existing GYRO_1_ALIGN

Please update configs/NEUTRONRCF745VTX/config.h accordingly, for example:

 #define GYRO_COUNT            2
+#define DEFAULT_GYRO_ENABLED  (GYRO_MASK(0) | GYRO_MASK(1))
+#define GYRO_2_ALIGN          <appropriate alignment>

– Replace <appropriate alignment> with the actual orientation for your second gyro.
[f​ix_required]

configs/EXUAVF4PRO/config.h (1)

30-30:

✅ Verification successful

LGTM! Verify consistency with other board configurations.

The addition of GYRO_COUNT 2 is correct and consistent with the existing dual gyro configuration evidenced by the GYRO_1_* and GYRO_2_* definitions in this file.

However, according to the AI summary, most other board configurations received both GYRO_COUNT and DEFAULT_GYRO_ENABLED macros. Please verify whether the DEFAULT_GYRO_ENABLED macro should also be added to this configuration for consistency.


🏁 Script executed:

#!/bin/bash
# Description: Check if other configs with GYRO_COUNT also have DEFAULT_GYRO_ENABLED
# Expected: Most configs should have both macros for consistency

echo "=== Checking configs that have GYRO_COUNT ==="
rg -l "GYRO_COUNT" configs/*/config.h

echo -e "\n=== Checking which of those also have DEFAULT_GYRO_ENABLED ==="
rg -l "GYRO_COUNT" configs/*/config.h | xargs rg -l "DEFAULT_GYRO_ENABLED"

echo -e "\n=== Checking configs that have GYRO_COUNT but NOT DEFAULT_GYRO_ENABLED ==="
rg -l "GYRO_COUNT" configs/*/config.h | xargs rg -L "DEFAULT_GYRO_ENABLED"

echo -e "\n=== Verifying EXUAVF4PRO has GYRO_2 definitions ==="
rg "GYRO_2" configs/EXUAVF4PRO/config.h

Length of output: 57199


GYRO_COUNT addition is correct; no DEFAULT_GYRO_ENABLED needed

All existing dual-gyro configurations in configs/EXUAVF4PRO/config.h (confirmed by the presence of GYRO_2_SPI_INSTANCE) now correctly define #define GYRO_COUNT 2. While some specialty boards do include a DEFAULT_GYRO_ENABLED macro, the majority of dual-gyro configs (including EXUAVF4PRO) do not—so omitting it here follows the established convention.

No further changes are required.

@haslinghuis haslinghuis changed the title Add 3+ IMU support (GYRO_COUNT and DEFAULT_GYRO_ENABLED) Fix some IMU configurations Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants