Skip to content

Conversation

@sensei-hacker
Copy link
Member

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

User description

Bring fix MATEKF405 variants BBL logging and [matekf405mini] sp3 across all variants into 8..x.x


PR Type

Bug fix, Enhancement


Description

  • Fix blackbox logging configuration for MATEKF405 variants

  • Add MATEKF405MINI target to build system

  • Standardize default features across all variants

  • Correct storage device selection logic


Changes diagram

flowchart LR
  A["MATEKF405 variants"] --> B["Fix storage logic"]
  B --> C["MINI uses SPI flash"]
  B --> D["Others use SD card"]
  A --> E["Add MINI target"]
  A --> F["Standardize features"]
Loading

Changes walkthrough 📝

Relevant files
Bug fix
target.h
Fix storage selection and feature configuration                   

src/main/target/MATEKF405/target.h

  • Inverted conditional logic for storage device selection
  • MATEKF405MINI now uses SPI flash instead of SD card
  • Removed variant-specific default features configuration
  • All variants now have consistent blackbox feature enabled
  • +9/-13   
    Enhancement
    CMakeLists.txt
    Add MATEKF405MINI build target                                                     

    src/main/target/MATEKF405/CMakeLists.txt

    • Added MATEKF405MINI target to build configuration
    +1/-0     

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

    Logic Inversion

    The conditional logic has been inverted from checking MATEKF405OSD to checking MATEKF405MINI. This changes the default storage device assignment for existing variants and should be verified to ensure MATEKF405OSD still gets SD card support as intended.

    #ifdef MATEKF405MINI
    // *************** M25P256 flash ********************
    #define USE_FLASHFS
    #define USE_FLASH_M25P16
    #define M25P16_SPI_BUS          BUS_SPI3
    #define M25P16_CS_PIN           PC0
    
    #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
    #else
    // *************** SD Card **************************
    #define USE_SDCARD
    #define USE_SDCARD_SPI
    #define SDCARD_SPI_BUS          BUS_SPI3
    #define SDCARD_CS_PIN           PC1
    
    #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
    #endif
    Feature Standardization

    All variants now have FEATURE_BLACKBOX enabled by default, removing the previous distinction where only MATEKF405 had blackbox enabled. This behavioral change should be validated to ensure it's intentional for all hardware variants.

    #define DEFAULT_FEATURES        (FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_BLACKBOX )
    #define CURRENT_METER_SCALE   179

    @qodo-code-review
    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Fix comment flash chip mismatch

    The comment mentions M25P256 flash but the code defines USE_FLASH_M25P16. This
    inconsistency could cause confusion during debugging or maintenance. Update the
    comment to match the actual flash chip being used.

    src/main/target/MATEKF405/target.h [56-72]

     #ifdef MATEKF405MINI
    -// *************** M25P256 flash ********************
    +// *************** M25P16 flash ********************
     #define USE_FLASHFS
     #define USE_FLASH_M25P16
     #define M25P16_SPI_BUS          BUS_SPI3
     #define M25P16_CS_PIN           PC0
     
     #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
     #else
     // *************** SD Card **************************
     #define USE_SDCARD
     #define USE_SDCARD_SPI
     #define SDCARD_SPI_BUS          BUS_SPI3
     #define SDCARD_CS_PIN           PC1
     
     #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
     #endif
    • Apply / Chat
    Suggestion importance[1-10]: 4

    __

    Why: The suggestion correctly identifies a mismatch between the comment mentioning M25P256 flash and the code defining USE_FLASH_M25P16, which improves code clarity and maintainability.

    Low
    • More

    @sensei-hacker sensei-hacker merged commit f3d0c1e into maintenance-8.x.x Jul 6, 2025
    41 checks passed
    @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