Skip to content

Commit 91546b6

Browse files
committed
bug: added code to force secondary mixer to follow primary mixer on param update when SECONDARY_MIXER is invalid
1 parent e4ae797 commit 91546b6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/mixer.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ void Mixer::param_change_callback(uint16_t param_id)
5959

6060
if ((param_id >=PARAM_PRIMARY_MIXER_OUTPUT_0 )&&(param_id <=PARAM_PRIMARY_MIXER_5_9 )) {
6161
load_primary_mixer_values();
62+
63+
// Check to see if the secondary mixer needs to be updated.
64+
// Without a call to init_mixing, the primary and secondary mixer parameters can get out of sync, if
65+
// the PARAM_SECONDARY_MIXER is set to an invalid mixer (and thus is defaulting to primary mixer).
66+
mixer_type_t mixer_choice = static_cast<mixer_type_t>(RF_.params_.get_param_int(PARAM_SECONDARY_MIXER));
67+
if (mixer_choice >= NUM_MIXERS) {
68+
secondary_mixer_ = primary_mixer_;
69+
save_secondary_mixer_params();
70+
}
6271
} else if ((param_id >=PARAM_SECONDARY_MIXER_0_0 )&&(param_id <=PARAM_SECONDARY_MIXER_5_9 )) {
6372
load_secondary_mixer_values();
6473
} else switch (param_id) {

0 commit comments

Comments
 (0)