diff --git a/src/main/fc/fc_msp_box.c b/src/main/fc/fc_msp_box.c index 54bdf68b05..464f2ab3d6 100644 --- a/src/main/fc/fc_msp_box.c +++ b/src/main/fc/fc_msp_box.c @@ -29,6 +29,7 @@ #include "fc/config.h" #include "fc/fc_msp_box.h" #include "fc/runtime_config.h" +#include "flight/mixer.h" #include "io/osd.h" @@ -77,6 +78,7 @@ static const box_t boxes[CHECKBOX_ITEM_COUNT + 1] = { { BOXOSDALT1, "OSD ALT 1", 42 }, { BOXOSDALT2, "OSD ALT 2", 43 }, { BOXOSDALT3, "OSD ALT 3", 44 }, + { BOXBRAKING, "MC BRAKING", 45 }, { CHECKBOX_ITEM_COUNT, NULL, 0xFF } }; @@ -188,6 +190,11 @@ void initActiveBoxIds(void) activeBoxIds[activeBoxIdCount++] = BOXHOMERESET; activeBoxIds[activeBoxIdCount++] = BOXGCSNAV; } + + if (mixerConfig()->platformType == PLATFORM_MULTIROTOR) { + activeBoxIds[activeBoxIdCount++] = BOXBRAKING; + } + #endif if (STATE(FIXED_WING)) { @@ -301,6 +308,7 @@ void packBoxModeFlags(boxBitmask_t * mspBoxModeFlags) CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXOSDALT2)), BOXOSDALT2); CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXOSDALT3)), BOXOSDALT3); CHECK_ACTIVE_BOX(IS_ENABLED(navigationTerrainFollowingEnabled()), BOXSURFACE); + CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXBRAKING)), BOXBRAKING); memset(mspBoxModeFlags, 0, sizeof(boxBitmask_t)); for (uint32_t i = 0; i < activeBoxIdCount; i++) { diff --git a/src/main/fc/rc_modes.h b/src/main/fc/rc_modes.h index 33bade3195..c0cd63198d 100755 --- a/src/main/fc/rc_modes.h +++ b/src/main/fc/rc_modes.h @@ -59,6 +59,7 @@ typedef enum { BOXOSDALT1 = 32, BOXOSDALT2 = 33, BOXOSDALT3 = 34, + BOXBRAKING = 35, CHECKBOX_ITEM_COUNT } boxId_e; diff --git a/src/main/navigation/navigation.c b/src/main/navigation/navigation.c index 1bef2c703b..eff24c0c87 100755 --- a/src/main/navigation/navigation.c +++ b/src/main/navigation/navigation.c @@ -1976,6 +1976,7 @@ static bool adjustPositionFromRCInput(void) * Process states only for POSHOLD. In any other case we go back to old routines */ if ( + IS_RC_MODE_ACTIVE(BOXBRAKING) && navConfig()->general.flags.user_control_mode == NAV_GPS_CRUISE && navConfig()->mc.braking_speed_threshold > 0 && (