Skip to content

Fixed top-LED update logic in grav* audioreactive effects#5602

Merged
softhack007 merged 2 commits into
wled:mainfrom
recliq:gravFx_fallrate_fix
May 11, 2026
Merged

Fixed top-LED update logic in grav* audioreactive effects#5602
softhack007 merged 2 commits into
wled:mainfrom
recliq:gravFx_fallrate_fix

Conversation

@recliq
Copy link
Copy Markdown
Contributor

@recliq recliq commented May 11, 2026

This patch should fix issue #5600

Summary by CodeRabbit

  • Bug Fixes
    • Fixed top-LED update logic in gravity-based visual modes so animations respect configured offsets, ensuring correct LED positioning and smoother gravity effects.

Review Change Stack

Fix topLED fallrate not responding to "Rate of fall" parameter.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

Walkthrough

This PR adjusts the threshold comparison in the mode_gravcenter_base function to account for the offset parameter when determining whether to update the top LED position. The threshold now compares tempsamp against gravcen->topLED + offset, aligning the cutoff behavior with gravity-based modes that apply positional offsets.

Changes

Gravity Center Top LED Offset Alignment

Layer / File(s) Summary
Threshold Comparison with Offset
wled00/FX.cpp
mode_gravcenter_base condition for updating gravcen->topLED now includes offset in threshold comparison: tempsamp >= gravcen->topLED + offset.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

effect

Suggested reviewers

  • DedeHai
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately describes the main change: fixing the top-LED update logic in gravity-based audioreactive effects by adjusting the comparison condition for offset-enabled modes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added the effect label May 11, 2026
Comment thread wled00/FX.cpp Outdated
Copy link
Copy Markdown
Collaborator

@DedeHai DedeHai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, since you tested the AI's suggestion, I am good with the change.

Added spaces
Copy link
Copy Markdown
Member

@softhack007 softhack007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, thanks 👍

@softhack007 softhack007 changed the title Update FX.cpp Fixed top-LED update logic in grav* audioreactive effects May 11, 2026
@softhack007 softhack007 merged commit f58187e into wled:main May 11, 2026
25 checks passed
softhack007 pushed a commit that referenced this pull request May 11, 2026
Fix topLED fallrate not responding to "Rate of fall" slider.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AR Gravcenter, Gravcentric and Gravfreq effects not reacting to "Rate of fall" Parameter

3 participants