1
0
Fork 0
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:
shota 2023-10-11 03:41:22 +09:00
parent 9847563559
commit 65fa493af1
5 changed files with 18 additions and 6 deletions

View file

@ -727,6 +727,8 @@ void processRx(timeUs_t currentTimeUs)
} else { } else {
DISABLE_FLIGHT_MODE(MANUAL_MODE); 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. /* In airmode Iterm should be prevented to grow when Low thottle and Roll + Pitch Centered.

View file

@ -202,7 +202,7 @@ void initActiveBoxIds(void)
//Camstab mode is enabled always //Camstab mode is enabled always
ADD_ACTIVE_BOX(BOXCAMSTAB); ADD_ACTIVE_BOX(BOXCAMSTAB);
if (STATE(MULTIROTOR)) { if (STATE(MULTIROTOR) || platformTypeConfigured(PLATFORM_MULTIROTOR) || platformTypeConfigured(PLATFORM_TRICOPTER)) {
if ((sensors(SENSOR_ACC) || sensors(SENSOR_MAG))) { if ((sensors(SENSOR_ACC) || sensors(SENSOR_MAG))) {
ADD_ACTIVE_BOX(BOXHEADFREE); ADD_ACTIVE_BOX(BOXHEADFREE);
ADD_ACTIVE_BOX(BOXHEADADJ); ADD_ACTIVE_BOX(BOXHEADADJ);
@ -244,13 +244,13 @@ void initActiveBoxIds(void)
#endif #endif
} }
if (STATE(AIRPLANE)) { if (STATE(AIRPLANE) || platformTypeConfigured(PLATFORM_AIRPLANE)) {
ADD_ACTIVE_BOX(BOXSOARING); ADD_ACTIVE_BOX(BOXSOARING);
} }
} }
#ifdef USE_MR_BRAKING_MODE #ifdef USE_MR_BRAKING_MODE
if (mixerConfig()->platformType == PLATFORM_MULTIROTOR) { if (mixerConfig()->platformType == PLATFORM_MULTIROTOR || platformTypeConfigured(PLATFORM_MULTIROTOR)) {
ADD_ACTIVE_BOX(BOXBRAKING); ADD_ACTIVE_BOX(BOXBRAKING);
} }
#endif #endif
@ -259,11 +259,12 @@ void initActiveBoxIds(void)
ADD_ACTIVE_BOX(BOXNAVALTHOLD); 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); ADD_ACTIVE_BOX(BOXMANUAL);
} }
if (STATE(AIRPLANE)) { if (STATE(AIRPLANE) || platformTypeConfigured(PLATFORM_AIRPLANE)) {
if (!feature(FEATURE_FW_LAUNCH)) { if (!feature(FEATURE_FW_LAUNCH)) {
ADD_ACTIVE_BOX(BOXNAVLAUNCH); ADD_ACTIVE_BOX(BOXNAVLAUNCH);
} }

View file

@ -108,6 +108,14 @@ void setMixerProfileAT(void)
mixerProfileAT.transitionTransEndTime = mixerProfileAT.transitionStartTime + (timeMs_t)currentMixerConfig.switchTransitionTimer * 100; 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) bool checkMixerATRequired(mixerProfileATRequest_e required_action)
{ {
//return false if mixerAT condition is not required or setting is not valid //return false if mixerAT condition is not required or setting is not valid

View file

@ -71,6 +71,7 @@ static inline const mixerProfile_t* mixerProfiles_CopyArray_by_index(int _index)
#define mixerMotorMixersByIndex(index) (mixerProfiles(index)->MotorMixers) #define mixerMotorMixersByIndex(index) (mixerProfiles(index)->MotorMixers)
#define mixerServoMixersByIndex(index) (mixerProfiles(index)->ServoMixers) #define mixerServoMixersByIndex(index) (mixerProfiles(index)->ServoMixers)
bool platformTypeConfigured(flyingPlatformType_e platformType);
bool outputProfileHotSwitch(int profile_index); bool outputProfileHotSwitch(int profile_index);
bool checkMixerProfileHotSwitchAvalibility(void); bool checkMixerProfileHotSwitchAvalibility(void);
void activateMixerConfig(void); void activateMixerConfig(void);

View file

@ -1130,7 +1130,7 @@ void FAST_CODE pidController(float dT)
canUseFpvCameraMix = false; // FPVANGLEMIX is incompatible with TURN_ASSISTANT 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); pidApplyFpvCameraAngleMix(pidState, currentControlRateProfile->misc.fpvCamAngleDegrees);
} }