Skip to content

Merge Maintenance 8.x.x to master#11056

Merged
sensei-hacker merged 23 commits into
masterfrom
maintenance-8.x.x
Oct 10, 2025
Merged

Merge Maintenance 8.x.x to master#11056
sensei-hacker merged 23 commits into
masterfrom
maintenance-8.x.x

Conversation

@sensei-hacker

@sensei-hacker sensei-hacker commented Oct 10, 2025

Copy link
Copy Markdown
Member

PR Type

Enhancement


Description

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

  • Fix MSP override receiver type reconfiguration race condition

  • Add five new flight controller targets

  • Update barometer and sensor configurations

  • Enhance TBS Lucid configuration with default modes


Diagram Walkthrough

flowchart LR
  A["MSP Override Fix"] --> B["Race Condition Prevention"]
  C["New Targets"] --> D["BRAHMA F405/F722"]
  C --> E["FLYCOLORF4"]
  C --> F["FOXEERF405V2"] 
  C --> G["SPEEDYBEEF405WINGV2"]
  H["Config Updates"] --> I["Baro I2C Changes"]
  H --> J["TBS Lucid Enhancements"]
Loading

File Walkthrough

Relevant files
Bug fix
1 files
msp_override.c
Fix MSP receiver reconfiguration race condition                   
+6/-0     
Enhancement
16 files
target.c
Add BRAHMA F405 timer hardware configuration                         
+41/-0   
target.h
Add BRAHMA F405 target definitions                                             
+149/-0 
target.c
Add BRAHMA F722 timer hardware configuration                         
+41/-0   
target.h
Add BRAHMA F722 target definitions                                             
+159/-0 
target.h
Add SPL06 barometer support                                                           
+5/-0     
target.c
Add FLYCOLORF4 timer hardware configuration                           
+38/-0   
target.h
Add FLYCOLORF4 target definitions                                               
+139/-0 
target.c
Add FOXEERF405V2 timer hardware configuration                       
+41/-0   
target.h
Add FOXEERF405V2 target definitions                                           
+159/-0 
config.c
Add SPEEDYBEEF405WINGV2 default configuration                       
+41/-0   
target.c
Add SPEEDYBEEF405WINGV2 timer hardware configuration         
+48/-0   
target.h
Add SPEEDYBEEF405WINGV2 target definitions                             
+174/-0 
config.c
Add PC13 pin and default mode configuration                           
+10/-1   
target.h
Add PINIO3 pin configuration                                                         
+2/-0     
config.c
Add default mode activation conditions                                     
+17/-3   
config.c
Add default mode and timer overrides                                         
+15/-4   
Configuration changes
7 files
target.h
Switch barometer from SPI to I2C2                                               
+5/-9     
settings.json
Add io.h to file associations                                                       
+2/-1     
CMakeLists.txt
Add BRAHMA F405 CMake target                                                         
+1/-0     
CMakeLists.txt
Add BRAHMA F722 CMake target                                                         
+1/-0     
CMakeLists.txt
Add FLYCOLORF4 CMake target                                                           
+1/-0     
CMakeLists.txt
Add FOXEERF405V2 CMake target                                                       
+1/-0     
CMakeLists.txt
Add SPEEDYBEEF405WINGV2 CMake target                                         
+1/-0     

mmosca and others added 23 commits January 24, 2025 17:18
…m-programming-framework

8.1 change gimbal sensitivity from programming framework
CADDXF4_AIO_ELRS baro uses i2c2
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
No custom compliance provided

Follow the guide to enable custom compliance check.

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Hardcoded defaults limit user configuration

The PR hardcodes default configurations for serial ports, RC modes, and timers
in targetConfiguration(), which will override user settings on each boot. These
defaults should only be applied when the configuration is being initialized to
avoid overwriting user preferences.

Examples:

src/main/target/SPEEDYBEEF405WINGV2/config.c [34-41]
void targetConfiguration(void)
{
    serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART6)].functionMask = FUNCTION_RX_SERIAL;
    serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART5)].functionMask = FUNCTION_GPS;
    serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART1)].functionMask = FUNCTION_MSP;

    pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
}
src/main/target/TBS_LUCID_H7_WING_MINI/config.c [36-47]
void targetConfiguration(void)
{
    pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;

    modeActivationConditionsMutable(0)->auxChannelIndex = 0;
    modeActivationConditionsMutable(0)->modeId = BOXUSER1;
    modeActivationConditionsMutable(0)->range.startStep = CHANNEL_VALUE_TO_STEP(CHANNEL_RANGE_MIN);
    modeActivationConditionsMutable(0)->range.endStep = CHANNEL_VALUE_TO_STEP(CHANNEL_RANGE_MAX);

    timerOverridesMutable(timer2id(TIM3))->outputMode = OUTPUT_MODE_SERVOS;

 ... (clipped 2 lines)

Solution Walkthrough:

Before:

// In src/main/target/SPEEDYBEEF405WINGV2/config.c
void targetConfiguration(void)
{
    // These settings are applied on every boot, overwriting user changes.
    serialConfigMutable()->portConfigs[...].functionMask = FUNCTION_RX_SERIAL;
    serialConfigMutable()->portConfigs[...].functionMask = FUNCTION_GPS;
    ...
}

// In src/main/target/TBS_LUCID_H7_WING_MINI/config.c
void targetConfiguration(void)
{
    // These settings are also applied on every boot.
    modeActivationConditionsMutable(0)->modeId = BOXUSER1;
    ...
    timerOverridesMutable(timer2id(TIM3))->outputMode = OUTPUT_MODE_SERVOS;
    timerOverridesMutable(timer2id(TIM4))->outputMode = OUTPUT_MODE_MOTORS;
}

After:

// In src/main/target/SPEEDYBEEF405WINGV2/config.c
void targetConfiguration(void)
{
    // Only apply defaults if the configuration is clean (e.g., after a reset).
    if (isConfigurationClean()) {
        serialConfigMutable()->portConfigs[...].functionMask = FUNCTION_RX_SERIAL;
        serialConfigMutable()->portConfigs[...].functionMask = FUNCTION_GPS;
        ...
    }
}

// In src/main/target/TBS_LUCID_H7_WING_MINI/config.c
void targetConfiguration(void)
{
    if (isConfigurationClean()) {
        modeActivationConditionsMutable(0)->modeId = BOXUSER1;
        ...
        timerOverridesMutable(timer2id(TIM3))->outputMode = OUTPUT_MODE_SERVOS;
        timerOverridesMutable(timer2id(TIM4))->outputMode = OUTPUT_MODE_MOTORS;
    }
}
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a significant usability flaw where hardcoded defaults in targetConfiguration() will override user settings on every boot, impacting multiple new and updated targets.

Medium
Possible issue
Validate array index before use

Add a check to ensure the index returned by findSerialPortIndexByIdentifier() is
not -1 before using it to access the portConfigs array.

src/main/target/SPEEDYBEEF405WINGV2/config.c [36-38]

-serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART6)].functionMask = FUNCTION_RX_SERIAL;
-serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART5)].functionMask = FUNCTION_GPS;
-serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART1)].functionMask = FUNCTION_MSP;
+int portIndex;
 
+portIndex = findSerialPortIndexByIdentifier(SERIAL_PORT_USART6);
+if (portIndex != -1) {
+    serialConfigMutable()->portConfigs[portIndex].functionMask = FUNCTION_RX_SERIAL;
+}
+
+portIndex = findSerialPortIndexByIdentifier(SERIAL_PORT_USART5);
+if (portIndex != -1) {
+    serialConfigMutable()->portConfigs[portIndex].functionMask = FUNCTION_GPS;
+}
+
+portIndex = findSerialPortIndexByIdentifier(SERIAL_PORT_USART1);
+if (portIndex != -1) {
+    serialConfigMutable()->portConfigs[portIndex].functionMask = FUNCTION_MSP;
+}
+
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly points out that findSerialPortIndexByIdentifier can return -1, and using this as an array index would cause an out-of-bounds access. Adding a check for the return value is a valid and important improvement for code safety and robustness.

Medium
Add null check for safety

Add a null check for the pointer returned by modeActivationConditionsMutable(0)
before dereferencing it to prevent a potential crash.

src/main/target/TBS_LUCID_H7_WING_MINI/config.c [40-43]

-modeActivationConditionsMutable(0)->auxChannelIndex = 0;
-modeActivationConditionsMutable(0)->modeId = BOXUSER1;
-modeActivationConditionsMutable(0)->range.startStep = CHANNEL_VALUE_TO_STEP(CHANNEL_RANGE_MIN);
-modeActivationConditionsMutable(0)->range.endStep = CHANNEL_VALUE_TO_STEP(CHANNEL_RANGE_MAX);
+modeActivationCondition_t *mac = modeActivationConditionsMutable(0);
+if (mac) {
+    mac->auxChannelIndex = 0;
+    mac->modeId = BOXUSER1;
+    mac->range.startStep = CHANNEL_VALUE_TO_STEP(CHANNEL_RANGE_MIN);
+    mac->range.endStep = CHANNEL_VALUE_TO_STEP(CHANNEL_RANGE_MAX);
+}
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies a missing null check, which could lead to a crash if modeActivationConditionsMutable(0) returns NULL. While the hardcoded index 0 is likely safe, adding the check improves code robustness and follows good defensive programming practices.

Low
  • More

@sensei-hacker
sensei-hacker merged commit a3286c1 into master Oct 10, 2025
43 of 44 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.

6 participants