Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace PASSTHROUGH with MANUAL flight mode (FW) #2661

Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
14502e0
FW: add manual flight mode
shellixyz Oct 31, 2017
a955bf5
manual mode: separate roll and pitch expo
shellixyz Oct 31, 2017
0aa0a75
manual flight mode: cleaning
shellixyz Jan 16, 2018
4e6a95b
Merge branch 'development' into development_manual_flight_mode_separa…
shellixyz Jan 16, 2018
a52bf62
replace PASSTHRU mode with MANUAL mode
shellixyz Jan 21, 2018
7ad5728
manual mode: merge pitch and roll expo
shellixyz Jan 21, 2018
e00ee80
manual mode: add OSD menu for manual rates and expo
shellixyz Jan 21, 2018
5d8259d
manual mode: forgot to add yaw rate adjustment in OSD menu
shellixyz Jan 21, 2018
c82b065
manual mode: add adjustments
shellixyz Jan 22, 2018
71c1530
fix indentation
shellixyz Jan 23, 2018
3936a95
Merge branch 'development_manual_flight_mode_separate_pitchroll_expo'…
shellixyz Jan 23, 2018
bba8620
fix indentation
shellixyz Jan 24, 2018
9c28150
manual mode: move rates applications in fc_core
shellixyz Jan 24, 2018
fc72312
group controlRateConfig settings by function
shellixyz Jan 24, 2018
afcf673
group controlRateConfig settings by function: fix ALIENFLIGHTF3 defau…
shellixyz Jan 24, 2018
af4430c
Merge branch 'development_manual_flight_mode_separate_pitchroll_expo'…
shellixyz Jan 24, 2018
7273418
manual mode rc adjustments: adapt to fc723121 changes
shellixyz Jan 24, 2018
8282e96
fix indentation
shellixyz Jan 24, 2018
2d01012
manual mode: clean rc adjustments
shellixyz Jan 24, 2018
d01af8f
add new MSPv2 messages: MSP2_INAV_RATE_PROFILE and MSP2_INAV_SET_RATE…
shellixyz Jan 25, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/main/cms/cms_menu_imu.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,35 @@ static CMS_Menu cmsx_menuPidGpsnav = {
.entries = cmsx_menuPidGpsnavEntries,
};

//
// MANUAL Rate & Expo
//
static OSD_Entry cmsx_menuManualRateProfileEntries[] =
{
{ "-- MANUAL RATE --", OME_Label, NULL, profileIndexString, 0 },

OSD_SETTING_ENTRY("MANU ROLL RATE", SETTING_MANUAL_ROLL_RATE),
OSD_SETTING_ENTRY("MANU PITCH RATE", SETTING_MANUAL_PITCH_RATE),
OSD_SETTING_ENTRY("MANU YAW RATE", SETTING_MANUAL_YAW_RATE),

OSD_SETTING_ENTRY("MANU RC EXPO", SETTING_RC_MANUAL_EXPO),
OSD_SETTING_ENTRY("MANU RC YAW EXP", SETTING_RC_MANUAL_YAW_EXPO),

{ "BACK", OME_Back, NULL, NULL, 0 },
{ NULL, OME_END, NULL, NULL, 0 }
};

static CMS_Menu cmsx_menuManualRateProfile = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUMANURATE",
.GUARD_type = OME_MENU,
#endif
.onEnter = NULL,
.onExit = NULL,
.onGlobalExit = NULL,
.entries = cmsx_menuManualRateProfileEntries
};

//
// Rate & Expo
//
Expand Down Expand Up @@ -423,6 +452,7 @@ static OSD_Entry cmsx_menuImuEntries[] =
// Rate profile dependent
{"RATE PROF", OME_UINT8, cmsx_profileIndexOnChange, &(OSD_UINT8_t){ &tmpProfileIndex, 1, MAX_CONTROL_RATE_PROFILE_COUNT, 1}, 0},
{"RATE", OME_Submenu, cmsMenuChange, &cmsx_menuRateProfile, 0},
{"MANU RATE", OME_Submenu, cmsMenuChange, &cmsx_menuManualRateProfile, 0},

// Global
{"GYRO GLB", OME_Submenu, cmsMenuChange, &cmsx_menuGyro, 0},
Expand Down
7 changes: 6 additions & 1 deletion src/main/fc/controlrate_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,19 @@ void pgResetFn_controlRateProfiles(controlRateConfig_t *instance)
for (int i = 0; i < MAX_CONTROL_RATE_PROFILE_COUNT; i++) {
RESET_CONFIG(controlRateConfig_t, &instance[i],
.rcExpo8 = 70,
.manual_rcExpo8 = 70,
.thrMid8 = 50,
.thrExpo8 = 0,
.dynThrPID = 0,
.rcYawExpo8 = 20,
.manual_rcYawExpo8 = 20,
.tpa_breakpoint = 1500,
.rates[FD_ROLL] = CONTROL_RATE_CONFIG_ROLL_PITCH_RATE_DEFAULT,
.rates[FD_PITCH] = CONTROL_RATE_CONFIG_ROLL_PITCH_RATE_DEFAULT,
.rates[FD_YAW] = CONTROL_RATE_CONFIG_YAW_RATE_DEFAULT
.rates[FD_YAW] = CONTROL_RATE_CONFIG_YAW_RATE_DEFAULT,
.manual_rates[FD_ROLL] = 100,
.manual_rates[FD_PITCH] = 100,
.manual_rates[FD_YAW] = 100
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we change the format of the PG wouldn't it be better to group entries by function? I.e.

  • Throttle/TPA settings
  • Stabilized mode settings/rates
  • Manual mode settings/rates?

Also note that since we change the in-storage format we need to bump up the version number of the PG definition here (the trailing 0):

PG_REGISTER_ARRAY_WITH_RESET_FN(controlRateConfig_t, MAX_CONTROL_RATE_PROFILE_COUNT, controlRateProfiles, PG_CONTROL_RATE_PROFILES, 0);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed will make the code clearer. Done.

);
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/fc/controlrate_profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,14 @@ and so on.
typedef struct controlRateConfig_s {
uint16_t tpa_breakpoint; // Breakpoint where TPA is activated
uint8_t rcExpo8;
uint8_t manual_rcExpo8;
uint8_t thrMid8;
uint8_t thrExpo8;
uint8_t rates[3];
uint8_t manual_rates[3];
uint8_t dynThrPID;
uint8_t rcYawExpo8;
uint8_t manual_rcYawExpo8;
} controlRateConfig_t;

PG_DECLARE_ARRAY(controlRateConfig_t, MAX_CONTROL_RATE_PROFILE_COUNT, controlRateProfiles);
Expand Down
17 changes: 9 additions & 8 deletions src/main/fc/fc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ void annexCode(void)
}
else {
// Compute ROLL PITCH and YAW command
rcCommand[ROLL] = getAxisRcCommand(rcData[ROLL], currentControlRateProfile->rcExpo8, rcControlsConfig()->deadband);
rcCommand[PITCH] = getAxisRcCommand(rcData[PITCH], currentControlRateProfile->rcExpo8, rcControlsConfig()->deadband);
rcCommand[YAW] = -getAxisRcCommand(rcData[YAW], currentControlRateProfile->rcYawExpo8, rcControlsConfig()->yaw_deadband);
rcCommand[ROLL] = getAxisRcCommand(rcData[ROLL], FLIGHT_MODE(MANUAL_MODE) ? currentControlRateProfile->manual_rcExpo8 : currentControlRateProfile->rcExpo8, rcControlsConfig()->deadband);
rcCommand[PITCH] = getAxisRcCommand(rcData[PITCH], FLIGHT_MODE(MANUAL_MODE) ? currentControlRateProfile->manual_rcExpo8 : currentControlRateProfile->rcExpo8, rcControlsConfig()->deadband);
rcCommand[YAW] = -getAxisRcCommand(rcData[YAW], FLIGHT_MODE(MANUAL_MODE) ? currentControlRateProfile->manual_rcYawExpo8 : currentControlRateProfile->rcYawExpo8, rcControlsConfig()->yaw_deadband);

//Compute THROTTLE command
throttleValue = constrain(rcData[THROTTLE], rxConfig()->mincheck, PWM_RANGE_MAX);
Expand Down Expand Up @@ -561,19 +561,20 @@ void processRx(timeUs_t currentTimeUs)

// Handle passthrough mode
if (STATE(FIXED_WING)) {
if ((IS_RC_MODE_ACTIVE(BOXPASSTHRU) && !navigationRequiresAngleMode() && !failsafeRequiresAngleMode()) || // Normal activation of passthrough
if ((IS_RC_MODE_ACTIVE(BOXMANUAL) && !navigationRequiresAngleMode() && !failsafeRequiresAngleMode()) || // Normal activation of passthrough
(!ARMING_FLAG(ARMED) && isCalibrating())){ // Backup - if we are not armed - enforce passthrough while calibrating
ENABLE_FLIGHT_MODE(PASSTHRU_MODE);
ENABLE_FLIGHT_MODE(MANUAL_MODE);
} else {
DISABLE_FLIGHT_MODE(PASSTHRU_MODE);
DISABLE_FLIGHT_MODE(MANUAL_MODE);
}
IS_RC_MODE_ACTIVE(BOXMANUAL) ? ENABLE_FLIGHT_MODE(MANUAL_MODE) : DISABLE_FLIGHT_MODE(MANUAL_MODE);
}

/* In airmode Iterm should be prevented to grow when Low thottle and Roll + Pitch Centered.
This is needed to prevent Iterm winding on the ground, but keep full stabilisation on 0 throttle while in air
Low Throttle + roll and Pitch centered is assuming the copter is on the ground. Done to prevent complex air/ground detections */
if (FLIGHT_MODE(PASSTHRU_MODE) || !ARMING_FLAG(ARMED)) {
/* In PASSTHRU mode we reset integrators prevent I-term wind-up (PID output is not used in PASSTHRU) */
if (FLIGHT_MODE(MANUAL_MODE) || !ARMING_FLAG(ARMED)) {
/* In MANUAL mode we reset integrators prevent I-term wind-up (PID output is not used in MANUAL) */
pidResetErrorAccumulators();
}
else {
Expand Down
6 changes: 3 additions & 3 deletions src/main/fc/fc_msp_box.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static const box_t boxes[CHECKBOX_ITEM_COUNT + 1] = {
{ BOXCAMSTAB, "CAMSTAB;", 8 },
{ BOXNAVRTH, "NAV RTH;", 10 }, // old GPS HOME
{ BOXNAVPOSHOLD, "NAV POSHOLD;", 11 }, // old GPS HOLD
{ BOXPASSTHRU, "PASSTHRU;", 12 },
{ BOXMANUAL, "MANUAL;", 12 },
{ BOXBEEPERON, "BEEPER;", 13 },
{ BOXLEDLOW, "LEDLOW;", 15 },
{ BOXLLIGHTS, "LLIGHTS;", 16 },
Expand Down Expand Up @@ -186,7 +186,7 @@ void initActiveBoxIds(void)
#endif

if (STATE(FIXED_WING)) {
activeBoxIds[activeBoxIdCount++] = BOXPASSTHRU;
activeBoxIds[activeBoxIdCount++] = BOXMANUAL;
activeBoxIds[activeBoxIdCount++] = BOXNAVLAUNCH;
activeBoxIds[activeBoxIdCount++] = BOXAUTOTRIM;
#if defined(AUTOTUNE_FIXED_WING)
Expand Down Expand Up @@ -252,7 +252,7 @@ void packBoxModeFlags(boxBitmask_t * mspBoxModeFlags)
CHECK_ACTIVE_BOX(IS_ENABLED(FLIGHT_MODE(HEADFREE_MODE)), BOXHEADFREE);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXHEADADJ)), BOXHEADADJ);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXCAMSTAB)), BOXCAMSTAB);
CHECK_ACTIVE_BOX(IS_ENABLED(FLIGHT_MODE(PASSTHRU_MODE)), BOXPASSTHRU);
CHECK_ACTIVE_BOX(IS_ENABLED(FLIGHT_MODE(MANUAL_MODE)), BOXMANUAL);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXBEEPERON)), BOXBEEPERON);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXLEDLOW)), BOXLEDLOW);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXLLIGHTS)), BOXLLIGHTS);
Expand Down
4 changes: 2 additions & 2 deletions src/main/fc/rc_modes.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ typedef enum {
BOXCAMSTAB = 7,
BOXNAVRTH = 8, // old GPSHOME
BOXNAVPOSHOLD = 9, // old GPSHOLD
BOXPASSTHRU = 10,
BOXMANUAL = 10,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation

BOXBEEPERON = 11,
BOXLEDLOW = 12,
BOXLLIGHTS = 13,
Expand Down Expand Up @@ -114,4 +114,4 @@ bool isRangeActive(uint8_t auxChannelIndex, const channelRange_t *range);

void updateActivatedModes(void);
void updateUsedModeActivationConditionFlags(void);
void configureModeActivationCondition(int macIndex, boxId_e modeId, uint8_t auxChannelIndex, uint16_t startPwm, uint16_t endPwm);
void configureModeActivationCondition(int macIndex, boxId_e modeId, uint8_t auxChannelIndex, uint16_t startPwm, uint16_t endPwm);
2 changes: 1 addition & 1 deletion src/main/fc/runtime_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ uint32_t sensorsMask(void)

flightModeForTelemetry_e getFlightModeForTelemetry(void)
{
if (FLIGHT_MODE(PASSTHRU_MODE))
if (FLIGHT_MODE(MANUAL_MODE))
return FLM_MANUAL;

if (FLIGHT_MODE(FAILSAFE_MODE))
Expand Down
14 changes: 7 additions & 7 deletions src/main/fc/runtime_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ typedef enum {
NAV_POSHOLD_MODE= (1 << 5), // old GPS_HOLD
HEADFREE_MODE = (1 << 6),
NAV_LAUNCH_MODE = (1 << 7),
PASSTHRU_MODE = (1 << 8),
FAILSAFE_MODE = (1 << 10),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note sure this is important but I just noticed I changed the mode values to fill the previously unused 10th bit. I don't know if this can have any side effect. Tell me if it is wrong I will restore them to the old values.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shellixyz probably it's better to keep things as they are. We are reporting flight mode flags to blackbox and rearranging the bits will make things all messed up.

AUTO_TUNE = (1 << 11), // old G-Tune
NAV_WP_MODE = (1 << 12),
UNUSED_MODE2 = (1 << 13),
FLAPERON = (1 << 14),
MANUAL_MODE = (1 << 8),
FAILSAFE_MODE = (1 << 9),
AUTO_TUNE = (1 << 10), // old G-Tune
NAV_WP_MODE = (1 << 11),
UNUSED_MODE2 = (1 << 12),
FLAPERON = (1 << 13),
#ifdef USE_FLM_TURN_ASSIST
TURN_ASSISTANT = (1 << 15),
TURN_ASSISTANT = (1 << 14),
#endif
} flightModeFlags_e;

Expand Down
20 changes: 20 additions & 0 deletions src/main/fc/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,18 @@ groups:
field: rcExpo8
min: 0
max: 100
- name: rc_manual_expo
field: manual_rcExpo8
min: 0
max: 100
- name: rc_yaw_expo
field: rcYawExpo8
min: 0
max: 100
- name: rc_manual_yaw_expo
field: manual_rcYawExpo8
min: 0
max: 100
- name: thr_mid
field: thrMid8
min: 0
Expand Down Expand Up @@ -592,6 +600,18 @@ groups:
- name: tpa_breakpoint
min: PWM_RANGE_MIN
max: PWM_RANGE_MAX
- name: manual_roll_rate
field: manual_rates[FD_ROLL]
min: 0
max: 100
- name: manual_pitch_rate
field: manual_rates[FD_PITCH]
min: 0
max: 100
- name: manual_yaw_rate
field: manual_rates[FD_YAW]
min: 0
max: 100

- name: PG_SERIAL_CONFIG
type: serialConfig_t
Expand Down
2 changes: 1 addition & 1 deletion src/main/flight/hil.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void hilUpdateControlState(void)
{
// FIXME: There must be a cleaner way to to this
// If HIL active, store PID outout into hilState and disable motor control
if (FLIGHT_MODE(PASSTHRU_MODE) || !STATE(FIXED_WING)) {
if (FLIGHT_MODE(MANUAL_MODE) || !STATE(FIXED_WING)) {
hilToSIM.pidCommand[ROLL] = rcCommand[ROLL];
hilToSIM.pidCommand[PITCH] = rcCommand[PITCH];
hilToSIM.pidCommand[YAW] = rcCommand[YAW];
Expand Down
2 changes: 1 addition & 1 deletion src/main/flight/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ void mixTable(void)
{
int16_t input[3]; // RPY, range [-500:+500]
// Allow direct stick input to motors in passthrough mode on airplanes
if (STATE(FIXED_WING) && FLIGHT_MODE(PASSTHRU_MODE)) {
if (STATE(FIXED_WING) && FLIGHT_MODE(MANUAL_MODE)) {
// Direct passthru from RX
input[ROLL] = rcCommand[ROLL];
input[PITCH] = rcCommand[PITCH];
Expand Down
2 changes: 1 addition & 1 deletion src/main/flight/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ static void pidApplyFixedWingRateController(pidState_t *pidState, flight_dynamic
}

#ifdef AUTOTUNE_FIXED_WING
if (FLIGHT_MODE(AUTO_TUNE) && !FLIGHT_MODE(PASSTHRU_MODE)) {
if (FLIGHT_MODE(AUTO_TUNE) && !FLIGHT_MODE(MANUAL_MODE)) {
autotuneFixedWingUpdate(axis, pidState->rateTarget, pidState->gyroRate, newPTerm + newFFTerm);
}
#endif
Expand Down
10 changes: 5 additions & 5 deletions src/main/flight/servos.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "fc/rc_controls.h"
#include "fc/rc_modes.h"
#include "fc/runtime_config.h"
#include "fc/controlrate_profile.h"

#include "flight/imu.h"
#include "flight/mixer.h"
Expand Down Expand Up @@ -365,11 +366,10 @@ void servoMixer(float dT)
{
int16_t input[INPUT_SOURCE_COUNT]; // Range [-500:+500]

if (FLIGHT_MODE(PASSTHRU_MODE)) {
// Direct passthru from RX
input[INPUT_STABILIZED_ROLL] = rcCommand[ROLL];
input[INPUT_STABILIZED_PITCH] = rcCommand[PITCH];
input[INPUT_STABILIZED_YAW] = rcCommand[YAW];
if (FLIGHT_MODE(MANUAL_MODE)) {
input[INPUT_STABILIZED_ROLL] = rcCommand[ROLL] * currentControlRateProfile->manual_rates[FD_ROLL] / 100L;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe manual_rates should be applied when calculating rcCommand values in annexCode. Mixer is not the right place to apply settings from controlRateProfile

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right.

input[INPUT_STABILIZED_PITCH] = rcCommand[PITCH] * currentControlRateProfile->manual_rates[FD_PITCH] / 100L;
input[INPUT_STABILIZED_YAW] = rcCommand[YAW] * currentControlRateProfile->manual_rates[FD_YAW] / 100L;
} else {
// Assisted modes (gyro only or gyro+acc according to AUX configuration in Gui
input[INPUT_STABILIZED_ROLL] = axisPID[ROLL];
Expand Down
4 changes: 2 additions & 2 deletions src/main/io/osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,8 @@ static bool osdDrawSingleElement(uint8_t item)
p = "AIR ";
}

if (FLIGHT_MODE(PASSTHRU_MODE))
p = "PASS";
if (FLIGHT_MODE(MANUAL_MODE))
p = "MANU";
else if (FLIGHT_MODE(FAILSAFE_MODE)) {
p = "!FS!";
} else if (FLIGHT_MODE(NAV_RTH_MODE))
Expand Down
6 changes: 3 additions & 3 deletions src/main/navigation/navigation.c
Original file line number Diff line number Diff line change
Expand Up @@ -2361,16 +2361,16 @@ static navigationFSMEvent_t selectNavEventFromBoxModeInput(void)
}
}

// RTH/Failsafe_RTH can override PASSTHRU
// RTH/Failsafe_RTH can override MANUAL
if (posControl.flags.forcedRTHActivated || (IS_RC_MODE_ACTIVE(BOXNAVRTH) && canActivatePosHold && canActivateAltHold && STATE(GPS_FIX_HOME))) {
// If we request forced RTH - attempt to activate it no matter what
// This might switch to emergency landing controller if GPS is unavailable
canActivateWaypoint = false; // Block WP mode if we switched to RTH for whatever reason
return NAV_FSM_EVENT_SWITCH_TO_RTH;
}

// PASSTHRU mode has priority over WP/PH/AH
if (IS_RC_MODE_ACTIVE(BOXPASSTHRU)) {
// MANUAL mode has priority over WP/PH/AH
if (IS_RC_MODE_ACTIVE(BOXMANUAL)) {
canActivateWaypoint = false; // Block WP mode if we are in PASSTHROUGH mode
return NAV_FSM_EVENT_SWITCH_TO_IDLE;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/rx/eleres.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static void telemetryRX(void)
themp = (uint8_t)(thempfil/80 + 86);

if (FLIGHT_MODE(FAILSAFE_MODE)) wii_flymode = 7;
else if (FLIGHT_MODE(PASSTHRU_MODE)) wii_flymode = 8;
else if (FLIGHT_MODE(MANUAL_MODE)) wii_flymode = 8;
else if (FLIGHT_MODE(NAV_RTH_MODE)) wii_flymode = 6;
else if (FLIGHT_MODE(NAV_POSHOLD_MODE)) wii_flymode = 5;
else if (FLIGHT_MODE(HEADFREE_MODE)) wii_flymode = 4;
Expand Down
2 changes: 1 addition & 1 deletion src/main/telemetry/ltm.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void ltm_sframe(sbuf_t *dst)
{
uint8_t lt_flightmode;

if (FLIGHT_MODE(PASSTHRU_MODE))
if (FLIGHT_MODE(MANUAL_MODE))
lt_flightmode = 0;
else if (FLIGHT_MODE(NAV_WP_MODE))
lt_flightmode = 10;
Expand Down
2 changes: 1 addition & 1 deletion src/main/telemetry/smartport.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ void handleSmartPortTelemetry(void)
tmpi += 10;
if (FLIGHT_MODE(HORIZON_MODE))
tmpi += 20;
if (FLIGHT_MODE(PASSTHRU_MODE))
if (FLIGHT_MODE(MANUAL_MODE))
tmpi += 40;

// hundreds column
Expand Down