1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-15 12:25:17 +03:00

add mixer_profile.h

This commit is contained in:
shota 2022-11-07 23:29:43 +09:00
parent 88e923122e
commit a9f8ebd5ff
21 changed files with 219 additions and 102 deletions

View file

@ -50,6 +50,7 @@
#include "io/osd_common.h"
#include "sensors/diagnostics.h"
#include "flight/mixer_profile.h"
#include "flight/mixer.h"
#include "flight/servos.h"
#include "drivers/pwm_mapping.h"
@ -369,16 +370,7 @@ static int logicConditionCompute(
operandA--;
if ( getConfigMixerProfile() != operandA && (operandA >= 0 && operandA < MAX_MIXER_PROFILE_COUNT)) {
bool mixerprofileChanged = false;
if (setConfigMixerProfile(operandA)) {
stopMotors();
stopPwmAllMotors();
servosInit();
mixerUpdateStateFlags();
mixerInit();
pwmMotorAndServoInit();
if (!STATE(ALTITUDE_CONTROL)) {
featureClear(FEATURE_AIRMODE);
}
if (OutputProfileHotSwitch(operandA)) {
mixerprofileChanged = true;
}
return mixerprofileChanged;