Skip to content

Fix secondary mixer initialization bug#465

Merged
avtoku merged 1 commit intomainfrom
jacob/fix-secondary-mixer-param-initialization
Nov 4, 2025
Merged

Fix secondary mixer initialization bug#465
avtoku merged 1 commit intomainfrom
jacob/fix-secondary-mixer-param-initialization

Conversation

@JMoore5353
Copy link
Contributor

When the secondary mixer is set to a number greater than NUM_MIXERS (the default for the secondary mixer is 255), then it defaults to have the same values as the primary mixer.

This PR adds a call to save the value of the secondary mixer to the params after setting the primary mixer value. Without this, the secondary mixer values used in code and the secondary mixer params get out of sync, which is confusing from a user perspective. In this case, the getting the secondary mixer values using the ROS service call does not return the correct value.

The previous workaround was to simply the newly loaded params to file and then restart the firmware, in which case the values for the secondary mixer were loaded properly (since the logic is correct in the init_mixing function call).

@JMoore5353 JMoore5353 requested review from avtoku and Copilot November 3, 2025 20:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a typo in a comment and optimizes the parameter handling in the mixer callback function. The changes improve performance by avoiding redundant function calls to retrieve the same parameter value multiple times.

  • Fixed spelling error in comment ("micer" → "mixer")
  • Optimized parameter retrieval by caching the float value in a local variable
  • Added synchronization logic to keep secondary mixer parameters in sync when mirroring the primary mixer

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@avtoku avtoku 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.

@avtoku avtoku merged commit 0443969 into main Nov 4, 2025
8 checks passed
@avtoku avtoku deleted the jacob/fix-secondary-mixer-param-initialization branch November 4, 2025 00:38
@JMoore5353 JMoore5353 linked an issue Nov 5, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Secondary mixer doesn't load when loading params from file

3 participants