Skip to content

Conversation

@sensei-hacker
Copy link
Member

@sensei-hacker sensei-hacker commented Jul 6, 2025

PR Type

Enhancement


Description

  • Switch barometer from SPI to I2C interface

  • Disable UART3 to free pins for I2C2

  • Update serial port count configuration


Changes diagram

flowchart LR
  A["Barometer"] -- "changed from" --> B["SPI2 + CS pin"]
  A -- "changed to" --> C["I2C2 bus"]
  D["UART3"] -- "disabled to free" --> E["I2C2 pins"]
Loading

Changes walkthrough 📝

Relevant files
Configuration changes
target.h
Switch barometer interface from SPI to I2C                             

src/main/target/CADDXF4_AIO_ELRS/target.h

  • Replaced BMP280 SPI configuration with I2C2 bus definition
  • Commented out UART3 configuration to free pins for I2C2
  • Updated serial port count from 5 to 4
  • Removed unused softserial configuration lines
  • +5/-9     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @sensei-hacker sensei-hacker marked this pull request as ready for review July 6, 2025 21:15
    @sensei-hacker sensei-hacker merged commit 052fbeb into maintenance-8.x.x Jul 6, 2025
    20 checks passed
    @qodo-code-review
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Missing I2C2 Definition

    The code adds BARO_I2C_BUS definition pointing to BUS_I2C2 but doesn't define the I2C2 bus itself with pins and configuration. This could cause compilation errors or runtime issues if I2C2 bus configuration is not defined elsewhere.

    #define BARO_I2C_BUS            BUS_I2C2
    Pin Conflict Risk

    UART3 pins PB11 and PB10 are being freed for I2C2 use, but there's no explicit I2C2 pin definition showing these pins are actually assigned to I2C2. Should verify that PB11/PB10 are the correct I2C2 pins for this hardware.

    //#define USE_UART3 // used by onboard baro i2c
    //#define UART3_RX_PIN            PB11
    //#define UART3_TX_PIN            PB10

    @qodo-code-review
    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Add missing I2C pin definitions

    The I2C2 bus definition is missing the required pin configuration for SCL and
    SDA lines. Without these pin definitions, the I2C2 bus cannot function properly
    and the barometer will not be accessible.

    src/main/target/CADDXF4_AIO_ELRS/target.h [43]

     #define BARO_I2C_BUS            BUS_I2C2
    +#define I2C2_SCL_PIN            PB10
    +#define I2C2_SDA_PIN            PB11
    • Apply / Chat
    Suggestion importance[1-10]: 10

    __

    Why: The suggestion correctly identifies that defining BARO_I2C_BUS requires corresponding SCL and SDA pin definitions for the I2C bus to be functional, which are missing in the PR.

    High
    • More

    @MrD-RC MrD-RC added this to the 9.0 milestone Oct 26, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    4 participants