Skip to content

Adds support for Airbot Theia OSD #4476

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 1 commit into
base: master
Choose a base branch
from

Conversation

freasy
Copy link
Member

@freasy freasy commented May 16, 2025

Adds support for the new Airbot Theia OSD chip.

  • Prevents incorrect display of "no OSD chip detected" message when using Theia OSD.
  • Disables features requiring Max7456 font device when using Theia OSD.

Airbot will release a new OSD chip "Theia" - it is a replacement for the MAX IC.

Requires:
#14391

Summary by CodeRabbit

  • New Features

    • Improved device detection in the OSD interface to recognize Airbot Theia OSD devices when supported by firmware version 1.45 or higher.
  • Bug Fixes

    • Refined visibility and enabled/disabled states for certain OSD UI elements based on the presence of Airbot Theia OSD devices, ensuring more accurate device status display.

Copy link
Contributor

coderabbitai bot commented May 16, 2025

Walkthrough

A new boolean state property, haveAirbotTheiaOsdDevice, is introduced in the OSD module. It is set based on specific flag and version checks. This property is incorporated into UI logic within the osd.initialize function to refine conditions for displaying or disabling certain UI elements related to OSD device detection.

Changes

File(s) Change Summary
src/js/tabs/osd.js Added haveAirbotTheiaOsdDevice state property, updated UI logic in updateOsdView to use this new property.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant OSD
    participant FlightController

    User->>UI: Loads OSD tab
    UI->>OSD: initialize()
    OSD->>FlightController: Request OSD data
    FlightController-->>OSD: Respond with flags and version
    OSD->>OSD: Decode flags and version
    OSD->>OSD: Set haveAirbotTheiaOsdDevice if conditions met
    OSD->>UI: updateOsdView()
    UI->>UI: Show/hide .noOsdChipDetect based on new logic
    UI->>UI: Enable/disable .requires-max7456-font-device-detected based on new logic
Loading

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 16c3b2e and 072ed7c.

📒 Files selected for processing (1)
  • src/js/tabs/osd.js (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/js/tabs/osd.js (3)
src/js/bit.js (1)
  • bit_check (1-3)
src/js/fc.js (1)
  • FC (130-992)
src/js/data_storage.js (2)
  • API_VERSION_1_45 (3-3)
  • API_VERSION_1_45 (3-3)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: deploy
🔇 Additional comments (3)
src/js/tabs/osd.js (3)

2368-2368: Good addition of the new Airbot Theia OSD device detection.

The code correctly sets the haveAirbotTheiaOsdDevice flag based on bit 7 of the flags and checks for compatibility with API version 1.45 or later, which is consistent with the PR objectives.


3021-3021: Correctly prevents "no OSD chip detected" message when using Theia OSD.

This modification properly includes the new haveAirbotTheiaOsdDevice check in the condition for displaying the "no OSD chip detected" message, ensuring it only shows when appropriate devices aren't detected.


3097-3097: Appropriately handles UI elements for Theia OSD compatibility.

The code now correctly handles the "disabled" class assignment for UI elements that require the Max7456 font device by considering the presence of the Airbot Theia OSD device.

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

Copy link
Contributor

Preview URL: https://3c63d463.betaflight-configurator.pages.dev

@@ -2365,6 +2365,7 @@ OSD.msp = {
d.state.haveMax7456Configured = bit_check(d.flags, 4);
d.state.haveFrSkyOSDConfigured = bit_check(d.flags, 3);
d.state.haveMax7456FontDeviceConfigured = d.state.haveMax7456Configured || d.state.haveFrSkyOSDConfigured;
d.state.haveAirbotTheiaOsdDevice = bit_check(d.flags, 7) && semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_45);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
d.state.haveAirbotTheiaOsdDevice = bit_check(d.flags, 7) && semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_45);
d.state.haveAirbotTheiaOsdDevice = bit_check(d.flags, 7) && semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47);

Copy link
Member

@VitroidFPV VitroidFPV left a comment

Choose a reason for hiding this comment

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

Lack any hardware to test, but this shouldn't break existing functionality either. Approving to be ready for FW merge

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

Successfully merging this pull request may close these issues.

3 participants