mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
Add OSD Profile feature - issue 4155
This commit is contained in:
parent
8a4ea0785e
commit
8d981df1a9
12 changed files with 227 additions and 66 deletions
|
@ -47,6 +47,7 @@
|
|||
#include "io/beeper.h"
|
||||
#include "io/motors.h"
|
||||
#include "io/pidaudio.h"
|
||||
#include "io/osd.h"
|
||||
|
||||
#include "fc/config.h"
|
||||
#include "fc/controlrate_profile.h"
|
||||
|
@ -237,6 +238,10 @@ static const adjustmentConfig_t defaultAdjustmentConfigs[ADJUSTMENT_FUNCTION_COU
|
|||
.adjustmentFunction = ADJUSTMENT_YAW_F,
|
||||
.mode = ADJUSTMENT_MODE_STEP,
|
||||
.data = { .step = 1 }
|
||||
}, {
|
||||
.adjustmentFunction = ADJUSTMENT_OSD_PROFILE,
|
||||
.mode = ADJUSTMENT_MODE_SELECT,
|
||||
.data = { .switchPositions = 3 }
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -273,7 +278,8 @@ static const char * const adjustmentLabels[] = {
|
|||
"PID AUDIO",
|
||||
"PITCH F",
|
||||
"ROLL F",
|
||||
"YAW F"
|
||||
"YAW F",
|
||||
"OSD PROFILE",
|
||||
};
|
||||
|
||||
static int adjustmentRangeNameIndex = 0;
|
||||
|
@ -657,6 +663,13 @@ static uint8_t applySelectAdjustment(adjustmentFunction_e adjustmentFunction, ui
|
|||
pidAudioSetMode(newMode);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
#ifdef USE_OSD_PROFILES
|
||||
case ADJUSTMENT_OSD_PROFILE:
|
||||
if (getCurrentOsdProfileIndex() != (position + 1)) {
|
||||
changeOsdProfileIndex(position+1);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
@ -776,7 +789,12 @@ void processRcAdjustments(controlRateConfig_t *controlRateConfig)
|
|||
}
|
||||
|
||||
#if defined(USE_OSD) && defined(USE_OSD_ADJUSTMENTS)
|
||||
if (newValue != -1 && adjustmentState->config->adjustmentFunction != ADJUSTMENT_RATE_PROFILE) { // Rate profile already has an OSD element
|
||||
if (newValue != -1
|
||||
&& adjustmentState->config->adjustmentFunction != ADJUSTMENT_RATE_PROFILE // Rate profile already has an OSD element
|
||||
#ifdef USE_OSD_PROFILES
|
||||
&& adjustmentState->config->adjustmentFunction != ADJUSTMENT_OSD_PROFILE
|
||||
#endif
|
||||
) {
|
||||
adjustmentRangeNameIndex = adjustmentFunction;
|
||||
adjustmentRangeValue = newValue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue