Skip to content

Commit

Permalink
[VTX] Revert "Fix VTX low power disarm ..." in preparation for #8939
Browse files Browse the repository at this point in the history
This reverts commit 0bd808d.
  • Loading branch information
functionpointer committed Nov 11, 2019
1 parent e4aafa0 commit f9be9d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
2 changes: 0 additions & 2 deletions src/main/drivers/vtx_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
#define VTX_TABLE_DEFAULT_CHANNEL 1
#define VTX_TABLE_DEFAULT_FREQ 5740
#define VTX_TABLE_DEFAULT_PITMODE_FREQ 0
#define VTX_TABLE_LOW_POWER_INDEX 1

#ifdef USE_VTX_RTC6705
#define VTX_TABLE_DEFAULT_POWER VTX_RTC6705_DEFAULT_POWER_INDEX
#else
Expand Down
28 changes: 2 additions & 26 deletions src/main/io/vtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
#include "common/time.h"

#include "drivers/vtx_common.h"
#if defined(USE_VTX_RTC6705)
#include "drivers/vtx_rtc6705.h"
#endif
#include "drivers/vtx_table.h"

#include "config/config.h"
Expand Down Expand Up @@ -112,27 +109,6 @@ void vtxInit(void)
}
}

// Once refactoring for RTC6705 to handle pit mode properly and remove the requirement
// for having a 0 value in the vtxtable power levels is completed then this function will
// no longer be required and the VTX_TABLE_LOW_POWER_INDEX value can always be used.
static uint8_t vtxGetMinimumPowerIndex(void)
{
const vtxDevice_t *vtxDevice = vtxCommonDevice();
vtxDevType_e vtxType = VTXDEV_UNKNOWN;
if (vtxDevice) {
vtxType = vtxCommonGetDeviceType(vtxDevice);
}
switch (vtxType) {
#if defined(USE_VTX_RTC6705)
case VTXDEV_RTC6705:
// special handling for rtc6705 which has the low power setting in index 2
return VTX_RTC6705_DEFAULT_POWER_INDEX;
#endif
default:
return VTX_TABLE_LOW_POWER_INDEX;
}
}

STATIC_UNIT_TESTED vtxSettingsConfig_t vtxGetSettings(void)
{
vtxSettingsConfig_t settings = {
Expand All @@ -148,14 +124,14 @@ STATIC_UNIT_TESTED vtxSettingsConfig_t vtxGetSettings(void)
if (IS_RC_MODE_ACTIVE(BOXVTXPITMODE) && settings.pitModeFreq) {
settings.band = 0;
settings.freq = settings.pitModeFreq;
settings.power = vtxGetMinimumPowerIndex();
settings.power = VTX_TABLE_DEFAULT_POWER;
}
#endif

if (!ARMING_FLAG(ARMED) && !failsafeIsActive() &&
(settings.lowPowerDisarm == VTX_LOW_POWER_DISARM_ALWAYS ||
(settings.lowPowerDisarm == VTX_LOW_POWER_DISARM_UNTIL_FIRST_ARM && !ARMING_FLAG(WAS_EVER_ARMED)))) {
settings.power = vtxGetMinimumPowerIndex();
settings.power = VTX_TABLE_DEFAULT_POWER;
}

return settings;
Expand Down

0 comments on commit f9be9d8

Please sign in to comment.