Skip to content

Commit

Permalink
Merge pull request iNavFlight#9339 from shota3527/sh_mixer_profile
Browse files Browse the repository at this point in the history
Fix mixer config initialization sequence
  • Loading branch information
DzikuVx authored Oct 4, 2023
2 parents ed9c412 + 3f5e7c1 commit bec12a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/fc/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ static void activateConfig(void)
{
activateControlRateConfig();
activateBatteryProfile();
activateMixerConfig();

resetAdjustmentStates();

Expand Down Expand Up @@ -486,7 +487,6 @@ bool setConfigMixerProfile(uint8_t profileIndex)
profileIndex = 0;
}
systemConfigMutable()->current_mixer_profile_index = profileIndex;
// setMixerProfile(profileIndex);
return ret;
}

Expand Down
8 changes: 6 additions & 2 deletions src/main/flight/mixer_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,15 @@ void pgResetFn_mixerProfiles(mixerProfile_t *instance)
}
}

void mixerConfigInit(void)
{
void activateMixerConfig(){
currentMixerProfileIndex = getConfigMixerProfile();
currentMixerConfig = *mixerConfig();
nextProfileIndex = (currentMixerProfileIndex + 1) % MAX_MIXER_PROFILE_COUNT;
}

void mixerConfigInit(void)
{
activateMixerConfig();
servosInit();
mixerUpdateStateFlags();
mixerInit();
Expand Down
1 change: 1 addition & 0 deletions src/main/flight/mixer_profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@ static inline const mixerProfile_t* mixerProfiles_CopyArray_by_index(int _index)

bool outputProfileHotSwitch(int profile_index);
bool checkMixerProfileHotSwitchAvalibility(void);
void activateMixerConfig(void);
void mixerConfigInit(void);
void outputProfileUpdateTask(timeUs_t currentTimeUs);

0 comments on commit bec12a9

Please sign in to comment.