Skip to content

Conversation

@haslinghuis
Copy link
Member

@haslinghuis haslinghuis commented Dec 16, 2025

  • Allows for testing virtual IMU in virtual mode.

Summary by CodeRabbit

  • Improvements
    • Enhanced gyro sensor detection with improved support for API v1.47+ and newer versions.
    • Added dual gyro hardware support for more accurate motion tracking and sensor configuration optimization.

✏️ Tip: You can customize this high-level summary in your review settings.

@haslinghuis haslinghuis added this to the 2025.12 milestone Dec 16, 2025
@haslinghuis haslinghuis self-assigned this Dec 16, 2025
@haslinghuis haslinghuis moved this to App in 2025.12.0 Dec 16, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

Walkthrough

VirtualFC.setVirtualConfig is updated to add API version-dependent gyro detection flags (3 for v1.47+, otherwise 1), introduce a gyro_enable_mask property set to (1 << 8) - 1, and assign dual gyro hardware IDs (13 and 22) in two configuration contexts.

Changes

Cohort / File(s) Change Summary
Gyro configuration updates
src/js/VirtualFC.js
Replaces fixed gyro_detection_flags with API-version-dependent logic; adds gyro_enable_mask property to SENSOR_ALIGNMENT; sets dual gyro hardware IDs (13, 22) at two initialization points

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Verify API version comparison logic (>= 1.47) is correct and consistent across codebase
  • Confirm dual gyro hardware ID values (13, 22) are appropriate and don't conflict with existing sensor configurations
  • Check that both occurrences of gyro_hardware assignment serve distinct purposes and are intentionally duplicated rather than refactoring opportunities

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is minimal and lacks required details such as motivation, technical explanation, or context. It only contains a brief one-line statement without addressing the template structure. Add a more comprehensive description explaining the rationale, what changes were made, which files were modified, and how to test the feature as suggested in the repository's PR guidelines.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add virtual dual IMU support for 1.47' is specific and directly related to the main change, which introduces dual gyro hardware IDs and API v1.47+ support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

🎉 Do you want to test this code? 🎉

⚠️ CAUTION: The build may be unstable and result in corrupted configurations or data loss. Use only for testing! ⚠️

Copy link
Contributor

@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: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1de94ca and 0617563.

📒 Files selected for processing (1)
  • src/js/VirtualFC.js (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: haslinghuis
Repo: betaflight/betaflight-configurator PR: 4532
File: src/js/VirtualFC.js:234-234
Timestamp: 2025-06-27T22:06:49.210Z
Learning: In the betaflight-configurator codebase, the VirtualFC.js AUX_CONFIG array must stay synchronized with the betaflight firmware's msp_box.c definitions to ensure proper auxiliary mode functionality. Changes to mode names should follow the firmware source code even if it potentially breaks backward compatibility with saved presets.
Learnt from: haslinghuis
Repo: betaflight/betaflight-configurator PR: 4532
File: src/js/VirtualFC.js:234-234
Timestamp: 2025-06-27T22:06:49.210Z
Learning: In the betaflight-configurator codebase, the VirtualFC.js AUX_CONFIG array must stay synchronized with the betaflight firmware's msp_box.c definitions to ensure proper auxiliary mode functionality. Changes to mode names should follow the firmware source code even if it potentially breaks backward compatibility with saved presets.
Learnt from: haslinghuis
Repo: betaflight/betaflight-configurator PR: 4611
File: src/tabs/configuration.html:247-249
Timestamp: 2025-09-15T15:19:47.087Z
Learning: In the Betaflight Configurator's configuration.html, duplicate "not found" elements using the same i18n key (like configurationSensorGyroToUseNotFound) may be intentionally placed in different UI sections that are conditionally displayed based on firmware version. The old gyro alignment section (.gyro_alignment_inputs_notfound) is used for older firmware, while the new gyro enable section (.gyro_notfound) is used for firmware 1.47+.
📚 Learning: 2025-06-27T22:06:49.210Z
Learnt from: haslinghuis
Repo: betaflight/betaflight-configurator PR: 4532
File: src/js/VirtualFC.js:234-234
Timestamp: 2025-06-27T22:06:49.210Z
Learning: In the betaflight-configurator codebase, the VirtualFC.js AUX_CONFIG array must stay synchronized with the betaflight firmware's msp_box.c definitions to ensure proper auxiliary mode functionality. Changes to mode names should follow the firmware source code even if it potentially breaks backward compatibility with saved presets.

Applied to files:

  • src/js/VirtualFC.js
📚 Learning: 2025-09-15T15:19:47.087Z
Learnt from: haslinghuis
Repo: betaflight/betaflight-configurator PR: 4611
File: src/tabs/configuration.html:247-249
Timestamp: 2025-09-15T15:19:47.087Z
Learning: In the Betaflight Configurator's configuration.html, duplicate "not found" elements using the same i18n key (like configurationSensorGyroToUseNotFound) may be intentionally placed in different UI sections that are conditionally displayed based on firmware version. The old gyro alignment section (.gyro_alignment_inputs_notfound) is used for older firmware, while the new gyro enable section (.gyro_notfound) is used for firmware 1.47+.

Applied to files:

  • src/js/VirtualFC.js
📚 Learning: 2025-08-27T22:07:26.353Z
Learnt from: haslinghuis
Repo: betaflight/betaflight-configurator PR: 4579
File: src/js/data_storage.js:9-9
Timestamp: 2025-08-27T22:07:26.353Z
Learning: In the betaflight-configurator CalVer refactoring, the generateVirtualApiVersions function in src/js/utils/common.js works correctly despite the apparent mathematical issue with bounds logic where compareVersions.minor() returns different ranges for API_VERSION_MAX_SUPPORTED (25.12.0) vs API_VERSION_ACCEPTED (1.44.0).

Applied to files:

  • src/js/VirtualFC.js
🧬 Code graph analysis (1)
src/js/VirtualFC.js (1)
src/js/data_storage.js (2)
  • API_VERSION_1_47 (5-5)
  • API_VERSION_1_47 (5-5)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build / build

@haslinghuis
Copy link
Member Author

@coderabbitai - both comments are resolved now.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

Tip

For best results, initiate chat on the files or code changes.

@haslinghuis Thank you for addressing both comments! I appreciate you taking the time to resolve the feedback. 🐰

    (\(\
    (='.')
    (")_(")
   Happy bunny!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: App

Development

Successfully merging this pull request may close these issues.

2 participants