Skip to content

Conversation

@sensei-hacker
Copy link
Member

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

User description

Fixing up issues with the original target.


PR Type

Bug fix, Enhancement


Description

  • Fixed LED strip configuration by enabling TIM_USE_LED flag on timer TMR3 CH3

  • Corrected MAX_PWM_OUTPUT_PORTS from 10 to 11 to match actual motor/servo outputs

  • Updated VBAT_SCALE_DEFAULT from 1600 to 1094 for accurate voltage readings

  • Cleaned up commented code and improved formatting


Diagram Walkthrough

flowchart LR
  A["Timer Configuration"] -- "Enable LED support" --> B["TMR3 CH3 PC8"]
  C["PWM Configuration"] -- "Increase count" --> D["MAX_PWM_OUTPUT_PORTS: 11"]
  E["Voltage Scaling"] -- "Correct calibration" --> F["VBAT_SCALE: 1094"]
Loading

File Walkthrough

Relevant files
Bug fix
target.c
Enable LED strip timer with proper flags                                 

src/main/target/DAKEFPVF435/target.c

  • Enabled TIM_USE_LED flag for TMR3 CH3 on PC8 pin
  • Removed commented-out LED strip timer definition
  • Fixed whitespace and formatting issues
+2/-3     
target.h
Correct PWM port count and voltage scaling                             

src/main/target/DAKEFPVF435/target.h

  • Increased MAX_PWM_OUTPUT_PORTS from 10 to 11
  • Updated VBAT_SCALE_DEFAULT from 1600 to 1094 for correct voltage
    measurement
+2/-2     

@sensei-hacker sensei-hacker merged commit 913f993 into iNavFlight:master Oct 12, 2025
20 checks passed
@qodo-code-review
Copy link
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
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Remove redundant timer usage flag

In the timer definition for the LED strip, remove the generic TIM_USE_ANY flag
and keep only the specific TIM_USE_LED flag to avoid redundancy and potential
configuration conflicts.

src/main/target/DAKEFPVF435/target.c [60]

-	DEF_TIM(TMR3, CH3, PC8,   TIM_USE_LED | TIM_USE_ANY, 0, 11),  // LED_STRIP
+	DEF_TIM(TMR3, CH3, PC8,   TIM_USE_LED, 0, 11),  // LED_STRIP
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly points out that using both TIM_USE_LED and TIM_USE_ANY is redundant and could lead to resource allocation issues. Using only the specific TIM_USE_LED flag improves code clarity and ensures the timer is exclusively used for its intended purpose.

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

2 participants