mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 16:25:26 +03:00
mixer_profile rcmodes changes
This commit is contained in:
parent
9847563559
commit
65fa493af1
5 changed files with 18 additions and 6 deletions
|
@ -727,6 +727,8 @@ void processRx(timeUs_t currentTimeUs)
|
|||
} else {
|
||||
DISABLE_FLIGHT_MODE(MANUAL_MODE);
|
||||
}
|
||||
}else{
|
||||
DISABLE_FLIGHT_MODE(MANUAL_MODE);
|
||||
}
|
||||
|
||||
/* In airmode Iterm should be prevented to grow when Low thottle and Roll + Pitch Centered.
|
||||
|
|
|
@ -202,7 +202,7 @@ void initActiveBoxIds(void)
|
|||
//Camstab mode is enabled always
|
||||
ADD_ACTIVE_BOX(BOXCAMSTAB);
|
||||
|
||||
if (STATE(MULTIROTOR)) {
|
||||
if (STATE(MULTIROTOR) || platformTypeConfigured(PLATFORM_MULTIROTOR) || platformTypeConfigured(PLATFORM_TRICOPTER)) {
|
||||
if ((sensors(SENSOR_ACC) || sensors(SENSOR_MAG))) {
|
||||
ADD_ACTIVE_BOX(BOXHEADFREE);
|
||||
ADD_ACTIVE_BOX(BOXHEADADJ);
|
||||
|
@ -244,13 +244,13 @@ void initActiveBoxIds(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
if (STATE(AIRPLANE)) {
|
||||
if (STATE(AIRPLANE) || platformTypeConfigured(PLATFORM_AIRPLANE)) {
|
||||
ADD_ACTIVE_BOX(BOXSOARING);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_MR_BRAKING_MODE
|
||||
if (mixerConfig()->platformType == PLATFORM_MULTIROTOR) {
|
||||
if (mixerConfig()->platformType == PLATFORM_MULTIROTOR || platformTypeConfigured(PLATFORM_MULTIROTOR)) {
|
||||
ADD_ACTIVE_BOX(BOXBRAKING);
|
||||
}
|
||||
#endif
|
||||
|
@ -259,11 +259,12 @@ void initActiveBoxIds(void)
|
|||
ADD_ACTIVE_BOX(BOXNAVALTHOLD);
|
||||
}
|
||||
|
||||
if (STATE(AIRPLANE) || STATE(ROVER) || STATE(BOAT)) {
|
||||
if (STATE(AIRPLANE) || STATE(ROVER) || STATE(BOAT) ||
|
||||
platformTypeConfigured(PLATFORM_AIRPLANE) || platformTypeConfigured(PLATFORM_ROVER) || platformTypeConfigured(PLATFORM_BOAT)) {
|
||||
ADD_ACTIVE_BOX(BOXMANUAL);
|
||||
}
|
||||
|
||||
if (STATE(AIRPLANE)) {
|
||||
if (STATE(AIRPLANE) || platformTypeConfigured(PLATFORM_AIRPLANE)) {
|
||||
if (!feature(FEATURE_FW_LAUNCH)) {
|
||||
ADD_ACTIVE_BOX(BOXNAVLAUNCH);
|
||||
}
|
||||
|
|
|
@ -108,6 +108,14 @@ void setMixerProfileAT(void)
|
|||
mixerProfileAT.transitionTransEndTime = mixerProfileAT.transitionStartTime + (timeMs_t)currentMixerConfig.switchTransitionTimer * 100;
|
||||
}
|
||||
|
||||
bool platformTypeConfigured(flyingPlatformType_e platformType)
|
||||
{
|
||||
if (!isModeActivationConditionPresent(BOXMIXERPROFILE)){
|
||||
return false;
|
||||
}
|
||||
return mixerConfigByIndex(nextProfileIndex)->platformType == platformType;
|
||||
}
|
||||
|
||||
bool checkMixerATRequired(mixerProfileATRequest_e required_action)
|
||||
{
|
||||
//return false if mixerAT condition is not required or setting is not valid
|
||||
|
|
|
@ -71,6 +71,7 @@ static inline const mixerProfile_t* mixerProfiles_CopyArray_by_index(int _index)
|
|||
#define mixerMotorMixersByIndex(index) (mixerProfiles(index)->MotorMixers)
|
||||
#define mixerServoMixersByIndex(index) (mixerProfiles(index)->ServoMixers)
|
||||
|
||||
bool platformTypeConfigured(flyingPlatformType_e platformType);
|
||||
bool outputProfileHotSwitch(int profile_index);
|
||||
bool checkMixerProfileHotSwitchAvalibility(void);
|
||||
void activateMixerConfig(void);
|
||||
|
|
|
@ -1130,7 +1130,7 @@ void FAST_CODE pidController(float dT)
|
|||
canUseFpvCameraMix = false; // FPVANGLEMIX is incompatible with TURN_ASSISTANT
|
||||
}
|
||||
|
||||
if (canUseFpvCameraMix && IS_RC_MODE_ACTIVE(BOXFPVANGLEMIX) && currentControlRateProfile->misc.fpvCamAngleDegrees) {
|
||||
if (canUseFpvCameraMix && IS_RC_MODE_ACTIVE(BOXFPVANGLEMIX) && currentControlRateProfile->misc.fpvCamAngleDegrees && STATE(MULTIROTOR)) {
|
||||
pidApplyFpvCameraAngleMix(pidState, currentControlRateProfile->misc.fpvCamAngleDegrees);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue