mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-22 15:55:40 +03:00
Braking enabled only on a switch
This commit is contained in:
parent
d1b064d4b8
commit
2fa3132e9a
3 changed files with 10 additions and 0 deletions
|
@ -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++) {
|
||||
|
|
|
@ -59,6 +59,7 @@ typedef enum {
|
|||
BOXOSDALT1 = 32,
|
||||
BOXOSDALT2 = 33,
|
||||
BOXOSDALT3 = 34,
|
||||
BOXBRAKING = 35,
|
||||
CHECKBOX_ITEM_COUNT
|
||||
} boxId_e;
|
||||
|
||||
|
|
|
@ -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 &&
|
||||
(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue