Skip to content

Conversation

@DzikuVx
Copy link
Member

@DzikuVx DzikuVx commented Jul 13, 2025

PR Type

Other


Description

This description is generated by an AI tool. It may have inaccuracies

  • Add complete FLYCOLORF4 flight controller target support

  • Configure 8 PWM outputs and LED strip functionality

  • Set up SPI buses for gyro, flash, and OSD

  • Enable 6 UART ports and I2C for sensors


Changes diagram

flowchart LR
  A["New Target"] --> B["Hardware Config"]
  B --> C["Timer Setup"]
  B --> D["SPI/I2C Buses"]
  B --> E["Sensor Support"]
  C --> F["8 PWM Outputs"]
  C --> G["LED Strip"]
  D --> H["Gyro/Flash/OSD"]
  E --> I["Baro/Mag/ADC"]
Loading

Changes walkthrough 📝

Relevant files
New target
target.h
Complete hardware configuration for FLYCOLORF4                     

src/main/target/FLYCOLORF4/target.h

  • Define hardware configuration for FLYCOLORF4 target
  • Configure SPI buses for gyro, flash memory, and OSD
  • Set up 6 UART ports and I2C for sensors
  • Enable ADC channels for battery, current, and RSSI
  • +139/-0 
    target.c
    Timer and PWM output configuration                                             

    src/main/target/FLYCOLORF4/target.c

  • Configure timer hardware for 8 PWM outputs
  • Map timers to specific GPIO pins for motor control
  • Set up LED strip timer on TIM1 CH3
  • +38/-0   
    Configuration changes
    CMakeLists.txt
    Build system configuration                                                             

    src/main/target/FLYCOLORF4/CMakeLists.txt

    • Add CMake build configuration for STM32F405 target
    +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.
  • @DzikuVx DzikuVx added this to the 8.1 milestone Jul 13, 2025
    @qodo-code-review
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    ⚡ Recommended focus areas for review

    Pin Conflict

    LED strip is configured to use pin PA10 which is already assigned to UART1_RX_PIN. This will cause a hardware conflict and prevent proper operation of both features.

    #define UART1_RX_PIN            PA10
    #define UART1_TX_PIN            PA9
    
    #define USE_UART2
    #define UART2_RX_PIN            PA3
    #define UART2_TX_PIN            PA2
    
    #define USE_UART3
    #define UART3_RX_PIN            PC11
    #define UART3_TX_PIN            PC10
    
    #define USE_UART4
    #define UART4_RX_PIN            PA1
    #define UART4_TX_PIN            PA0
    
    #define USE_UART5   
    #define UART5_RX_PIN            PD2  
    #define UART5_TX_PIN            PC12  
    
    #define USE_UART6   
    #define UART6_RX_PIN            PC7
    #define UART6_TX_PIN            PC6
    
    #define SERIAL_PORT_COUNT       7
    
    /*** BARO & MAG ***/
    #define USE_BARO
    #define BARO_I2C_BUS            BUS_I2C2
    #define USE_BARO_ALL
    
    #define USE_MAG
    #define MAG_I2C_BUS             BUS_I2C2
    #define USE_MAG_ALL
    
    /*** ADC ***/
    #define USE_ADC
    #define ADC_CHANNEL_1_PIN               PC0
    #define ADC_CHANNEL_2_PIN               PC1
    #define ADC_CHANNEL_3_PIN               PC5
    
    #define VBAT_ADC_CHANNEL                ADC_CHN_1
    #define CURRENT_METER_ADC_CHANNEL       ADC_CHN_2
    #define RSSI_ADC_CHANNEL                ADC_CHN_3
    
    /*** LED STRIP ***/
    #define USE_LED_STRIP
    #define WS2811_PIN                      PA10
    Code Style

    Inconsistent spacing and formatting in the timer hardware array. Some lines have trailing spaces and inconsistent indentation which affects code readability.

    timerHardware_t timerHardware[] = {
    
        DEF_TIM(TIM4,  CH1, PB6,  TIM_USE_OUTPUT_AUTO,     0, 0),   // S1
        DEF_TIM(TIM4,  CH2, PB7,  TIM_USE_OUTPUT_AUTO,     0, 0),   // S2
        DEF_TIM(TIM4,  CH3, PB8,  TIM_USE_OUTPUT_AUTO,     0, 0),   // S3
        DEF_TIM(TIM4,  CH4, PB9,  TIM_USE_OUTPUT_AUTO,     0, 0),   // S4  
        DEF_TIM(TIM3,  CH3, PB0,  TIM_USE_OUTPUT_AUTO,     0, 0),   // S5 
        DEF_TIM(TIM3,  CH4, PB1,  TIM_USE_OUTPUT_AUTO,     0, 0),   // S6
        DEF_TIM(TIM8,  CH3, PC8,  TIM_USE_OUTPUT_AUTO,     0, 0),   // S7
        DEF_TIM(TIM2,  CH1, PA15, TIM_USE_OUTPUT_AUTO,     0, 0),   // S8
    
        DEF_TIM(TIM1,  CH3, PB14, TIM_USE_LED,                        0, 0),   // LED STRIP(2,6)
    };

    @qodo-code-review
    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Fix LED strip pin conflict

    The LED strip pin PA10 conflicts with UART1 RX pin defined earlier. This will
    cause hardware conflicts and prevent proper operation of either the LED strip or
    UART1.

    src/main/target/FLYCOLORF4/target.h [116-117]

     #define USE_LED_STRIP
    -#define WS2811_PIN                      PA10
    +#define WS2811_PIN                      PB14
    • Apply / Chat
    Suggestion importance[1-10]: 10

    __

    Why: The suggestion correctly identifies a critical hardware pin conflict between WS2811_PIN and UART1_RX_PIN, both assigned to PA10, and provides the correct fix consistent with the timer definitions in target.c.

    High
    • More

    @DzikuVx DzikuVx merged commit e6296c5 into maintenance-8.x.x Jul 13, 2025
    21 checks passed
    @DzikuVx DzikuVx deleted the flycolorf4-target branch July 13, 2025 17:25
    @MrD-RC MrD-RC modified the milestones: 8.1, 9.0 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.

    3 participants