Skip to content

Conversation

@haslinghuis
Copy link
Member

@haslinghuis haslinghuis commented Aug 11, 2025

Summary by CodeRabbit

  • New Features

    • Added DPS310 barometer support for BETAFPVF405 ELRS, enabling altitude and pressure readings when this sensor is present.
  • Refactor

    • Streamlined sensor configuration by removing redundant settings and the default “no barometer” selection to improve barometer detection behavior.

@haslinghuis haslinghuis self-assigned this Aug 11, 2025
@haslinghuis haslinghuis changed the title Add SPI DPS310 baro define (BETAFPVF405_ELRS Add SPI DPS310 baro define (BETAFPVF405_ELRS) Aug 11, 2025
@ot0tot
Copy link
Contributor

ot0tot commented Aug 11, 2025

Why is #define DEFAULT_BARO_DEVICE BARO_NONE included in the config?

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 11, 2025

Walkthrough

Adds DPS310 barometer support to BETAFPVF405_ELRS by defining USE_BARO_SPI_DPS310, removes DEFAULT_BARO_DEVICE BARO_NONE, and consolidates ADC configuration by defining ADC_INSTANCE ADC2 while removing a duplicate definition.

Changes

Cohort / File(s) Summary
Board config: BETAFPVF405_ELRS
configs/BETAFPVF405_ELRS/config.h
Added USE_BARO_SPI_DPS310; added ADC_INSTANCE ADC2; removed DEFAULT_BARO_DEVICE BARO_NONE; removed duplicate ADC_INSTANCE ADC2 definition.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Assessment against linked issues

Objective Addressed Explanation
Enable DPS310 barometer support for BETAFPVF405_ELRS (#1368)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Introduced/cleaned up ADC_INSTANCE ADC2 definition (configs/BETAFPVF405_ELRS/config.h) ADC configuration changes are not mentioned in #1368, which focuses solely on DPS310 barometer support.

Possibly related PRs

Suggested reviewers

  • ot0tot
  • nerdCopter
  • KarateBrot

📜 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 c97b83a and 8422fd7.

📒 Files selected for processing (1)
  • configs/BETAFPVF405_ELRS/config.h (2 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: haslinghuis
PR: betaflight/config#719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Out of 264 boards using these drivers, 259 (98%) work without USE_I2C defined, indicating that the I2C dependency is handled automatically by the build system.
Learnt from: haslinghuis
PR: betaflight/config#719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Many existing boards successfully use USE_BARO_BMP280 and USE_BARO_DPS310 without defining USE_I2C, indicating that the I2C dependency is handled automatically by the build system or these sensors support alternative communication methods.
📚 Learning: 2025-07-25T20:06:07.492Z
Learnt from: haslinghuis
PR: betaflight/config#719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Many existing boards successfully use USE_BARO_BMP280 and USE_BARO_DPS310 without defining USE_I2C, indicating that the I2C dependency is handled automatically by the build system or these sensors support alternative communication methods.

Applied to files:

  • configs/BETAFPVF405_ELRS/config.h
📚 Learning: 2025-07-25T20:06:07.492Z
Learnt from: haslinghuis
PR: betaflight/config#719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Out of 264 boards using these drivers, 259 (98%) work without USE_I2C defined, indicating that the I2C dependency is handled automatically by the build system.

Applied to files:

  • configs/BETAFPVF405_ELRS/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-06-02T16:16:20.197Z
Learning: In STM32F405-based flight controller configurations, timer pin mappings must be carefully analyzed for DMA stream conflicts, especially between motor timers, LED strip timers, and SPI DMA assignments. Changes to TIMER_PIN_MAPPING should include verification that all required peripherals (motors, LED strip, blackbox SPI) can coexist without DMA conflicts.

Applied to files:

  • configs/BETAFPVF405_ELRS/config.h
📚 Learning: 2025-07-14T15:41:14.364Z
Learnt from: ot0tot
PR: betaflight/config#834
File: configs/RADIOLINKF405/config.h:79-88
Timestamp: 2025-07-14T15:41:14.364Z
Learning: In STM32F405 configurations, PB1 typically maps to TIM3_CH4 and PC9 typically maps to TIM8_CH4. These are different timers and do not share DMA resources, so there is no conflict when both pins are used simultaneously (e.g., PB1 for LED_STRIP and PC9 for MOTOR4).

Applied to files:

  • configs/BETAFPVF405_ELRS/config.h
📚 Learning: 2025-05-31T17:01:39.423Z
Learnt from: haslinghuis
PR: betaflight/config#798
File: configs/FURYF4OSD/config.h:88-88
Timestamp: 2025-05-31T17:01:39.423Z
Learning: For STM32F4xx platforms, PB1 pin timer definitions are:
1 = DEF_TIM(TIM1, CH3N, PB1, 0, 0)
2 = DEF_TIM(TIM3, CH4, PB1, 0, 0) 
3 = DEF_TIM(TIM8, CH3N, PB1, 0, 0)
Timer instance 2 (TIM3, CH4) is the correct mapping for PB1 motor control on STM32F4xx platforms as defined in src/platform/STM32/timer_stm32f4xx.c

Applied to files:

  • configs/BETAFPVF405_ELRS/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-06-02T16:16:20.197Z
Learning: For Betaflight configurations, blackbox logging via SPI3 and LED_STRIP functionality can be mutually exclusive due to DMA stream conflicts on STM32F4 targets. This hardware limitation should be identified during timer configuration reviews.

Applied to files:

  • configs/BETAFPVF405_ELRS/config.h
🔇 Additional comments (2)
configs/BETAFPVF405_ELRS/config.h (2)

96-96: No duplicate ADC_INSTANCE definitions detected

A repository-wide search shows that ADC_INSTANCE is defined exactly once in configs/BETAFPVF405_ELRS/config.h (line 96) and other occurrences are in separate config files. There are no conflicting or duplicate definitions in this config.


38-38: DPS310 SPI barometer configuration validated for BETAFPVF405_ELRS

  • No DEFAULT_BARO_DEVICE defined in configs/BETAFPVF405_ELRS/config.h.
  • Baro drivers enabled at lines 36–38:
    USE_BARO
    USE_BARO_SPI_BMP280
    USE_BARO_SPI_DPS310
  • BARO_SPI_INSTANCE SPI3 confirmed at line 97.
  • BARO_CS_PIN PB3 confirmed at line 76.
  • Single ADC_INSTANCE ADC2 at line 96, with no duplicates.

Please verify that the resulting firmware binary still fits within the target’s flash.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch haslinghuis-patch-9

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

Support

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

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 generate unit tests to generate unit tests for 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.

@haslinghuis haslinghuis merged commit 43d6a02 into master Aug 13, 2025
2 checks passed
@haslinghuis haslinghuis deleted the haslinghuis-patch-9 branch August 13, 2025 08:39
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.

manufacturer_id BEFH, board_name BETAFPVF405_ELRS, missing barometer driver - ID : "0aff22e8-7e09-4d56-9046-3879c75c87b5

5 participants