1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 04:45:24 +03:00

Removed changes not required for the backport into 4.1.

This commit is contained in:
Michael Keller 2020-01-14 15:45:27 +13:00
parent 73956581b2
commit 9b1b4844d2
9 changed files with 11 additions and 58 deletions

View file

@ -63,7 +63,6 @@
#include "io/gimbal.h"
#include "io/gps.h"
#include "io/ledstrip.h"
#include "io/serial.h"
#include "io/vtx.h"
#include "io/vtx_control.h"
#include "io/vtx_rtc6705.h"
@ -482,10 +481,6 @@ static const char* const lookupTableDshotBitbangedTimer[] = {
"AUTO", "TIM1", "TIM8"
};
static const char * const lookupTableOsdDisplayPortDevice[] = {
"NONE", "AUTO", "MAX7456", "MSP",
};
#define LOOKUP_TABLE_ENTRY(name) { name, ARRAYLEN(name) }
@ -604,7 +599,6 @@ const lookupTableEntry_t lookupTables[] = {
LOOKUP_TABLE_ENTRY(lookupTableOffOnAuto),
LOOKUP_TABLE_ENTRY(lookupTableInterpolatedSetpoint),
LOOKUP_TABLE_ENTRY(lookupTableDshotBitbangedTimer),
LOOKUP_TABLE_ENTRY(lookupTableOsdDisplayPortDevice),
};
#undef LOOKUP_TABLE_ENTRY
@ -1359,7 +1353,6 @@ const clivalue_t valueTable[] = {
{ "osd_profile_3_name", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, OSD_PROFILE_NAME_LENGTH, STRING_FLAGS_NONE }, PG_OSD_CONFIG, offsetof(osdConfig_t, profile[2]) },
#endif
{ "osd_gps_sats_show_hdop", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_OSD_CONFIG, offsetof(osdConfig_t, gps_sats_show_hdop) },
{ "osd_displayport_device", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OSD_DISPLAYPORT_DEVICE }, PG_OSD_CONFIG, offsetof(osdConfig_t, displayPortDevice) },
#endif
// PG_SYSTEM_CONFIG
@ -1417,7 +1410,6 @@ const clivalue_t valueTable[] = {
#ifdef USE_MSP_DISPLAYPORT
{ "displayport_msp_col_adjust", VAR_INT8 | MASTER_VALUE, .config.minmax = { -6, 0 }, PG_DISPLAY_PORT_MSP_CONFIG, offsetof(displayPortProfile_t, colAdjust) },
{ "displayport_msp_row_adjust", VAR_INT8 | MASTER_VALUE, .config.minmax = { -3, 0 }, PG_DISPLAY_PORT_MSP_CONFIG, offsetof(displayPortProfile_t, rowAdjust) },
{ "displayport_msp_serial", VAR_INT8 | MASTER_VALUE, .config.minmax = { SERIAL_PORT_NONE, SERIAL_PORT_IDENTIFIER_MAX }, PG_DISPLAY_PORT_MSP_CONFIG, offsetof(displayPortProfile_t, displayPortSerial) },
#endif
// PG_DISPLAY_PORT_MSP_CONFIG

View file

@ -138,7 +138,6 @@ typedef enum {
TABLE_OFF_ON_AUTO,
TABLE_INTERPOLATED_SP,
TABLE_DSHOT_BITBANGED_TIMER,
TABLE_OSD_DISPLAYPORT_DEVICE,
LOOKUP_TABLE_COUNT
} lookupTableIndex_e;

View file

@ -60,7 +60,6 @@ typedef struct displayPortProfile_s {
bool invert;
uint8_t blackBrightness;
uint8_t whiteBrightness;
int8_t displayPortSerial; // serialPortIdentifier_e
} displayPortProfile_t;
// Note: displayPortProfile_t used as a parameter group for CMS over CRSF (io/displayport_crsf)

View file

@ -799,38 +799,16 @@ void init(void)
//The OSD need to be initialised after GYRO to avoid GYRO initialisation failure on some targets
if (featureIsEnabled(FEATURE_OSD)) {
osdDisplayPortDevice_e device = osdConfig()->displayPortDevice;
switch(device) {
case OSD_DISPLAYPORT_DEVICE_AUTO:
FALLTHROUGH;
#if defined(USE_MAX7456)
case OSD_DISPLAYPORT_DEVICE_MAX7456:
// If there is a max7456 chip for the OSD configured and detectd then use it.
osdDisplayPort = max7456DisplayPortInit(vcdProfile());
if (osdDisplayPort || device == OSD_DISPLAYPORT_DEVICE_MAX7456) {
break;
}
FALLTHROUGH;
// If there is a max7456 chip for the OSD configured and detectd then use it.
osdDisplayPort = max7456DisplayPortInit(vcdProfile());
#endif
#if defined(USE_CMS) && defined(USE_MSP_DISPLAYPORT) && defined(USE_OSD_OVER_MSP_DISPLAYPORT)
case OSD_DISPLAYPORT_DEVICE_MSP:
if (!osdDisplayPort) {
osdDisplayPort = displayPortMspInit();
if (osdDisplayPort || device == OSD_DISPLAYPORT_DEVICE_MSP) {
break;
}
FALLTHROUGH;
#endif
// Other device cases can be added here
case OSD_DISPLAYPORT_DEVICE_NONE:
default:
break;
}
#endif
// osdInit will register with CMS by itself.
osdInit(osdDisplayPort);

View file

@ -88,8 +88,7 @@ typedef enum {
SERIAL_PORT_USART8,
SERIAL_PORT_USB_VCP = 20,
SERIAL_PORT_SOFTSERIAL1 = 30,
SERIAL_PORT_SOFTSERIAL2,
SERIAL_PORT_IDENTIFIER_MAX = SERIAL_PORT_SOFTSERIAL2
SERIAL_PORT_SOFTSERIAL2
} serialPortIdentifier_e;
extern const serialPortIdentifier_e serialPortIdentifiers[SERIAL_PORT_COUNT];

View file

@ -35,7 +35,6 @@
#include "drivers/system.h"
#include "io/serial.h"
#include "io/displayport_msp.h"
#include "msp/msp.h"
@ -58,7 +57,6 @@ void mspSerialAllocatePorts(void)
serialPortConfig_t *portConfig = findSerialPortConfig(FUNCTION_MSP);
while (portConfig && portIndex < MAX_MSP_PORT_COUNT) {
mspPort_t *mspPort = &mspPorts[portIndex];
if (mspPort->port) {
portIndex++;
continue;
@ -68,13 +66,6 @@ void mspSerialAllocatePorts(void)
if (serialPort) {
bool sharedWithTelemetry = isSerialPortShared(portConfig, FUNCTION_MSP, TELEMETRY_PORT_FUNCTIONS_MASK);
resetMspPort(mspPort, serialPort, sharedWithTelemetry);
#ifdef USE_MSP_DISPLAYPORT
if (serialPort->identifier == displayPortProfileMsp()->displayPortSerial) {
mspPort->isDisplayPort = true;
}
#endif
portIndex++;
}
@ -571,8 +562,12 @@ int mspSerialPush(uint8_t cmd, uint8_t *data, int datalen, mspDirection_e direct
for (int portIndex = 0; portIndex < MAX_MSP_PORT_COUNT; portIndex++) {
mspPort_t * const mspPort = &mspPorts[portIndex];
if (!mspPort->port) {
continue;
}
if (!mspPort->port || !mspPort->isDisplayPort) {
// XXX Kludge!!! Avoid zombie VCP port (avoid VCP entirely for now)
if (mspPort->port->identifier == SERIAL_PORT_USB_VCP) {
continue;
}

View file

@ -111,7 +111,6 @@ typedef struct mspPort_s {
uint8_t checksum2;
bool sharedWithTelemetry;
mspDescriptor_t descriptor;
bool isDisplayPort;
} mspPort_t;
void mspSerialInit(void);

View file

@ -219,13 +219,6 @@ typedef enum {
OSD_WARNING_COUNT // MUST BE LAST
} osdWarningsFlags_e;
typedef enum {
OSD_DISPLAYPORT_DEVICE_NONE = 0,
OSD_DISPLAYPORT_DEVICE_AUTO,
OSD_DISPLAYPORT_DEVICE_MAX7456,
OSD_DISPLAYPORT_DEVICE_MSP,
} osdDisplayPortDevice_e;
// Make sure the number of warnings do not exceed the available 32bit storage
STATIC_ASSERT(OSD_WARNING_COUNT <= 32, osdwarnings_overflow);
@ -258,7 +251,7 @@ typedef struct osdConfig_s {
int16_t esc_rpm_alarm;
int16_t esc_current_alarm;
uint8_t core_temp_alarm;
uint8_t ahInvert; // invert the artificial horizon
uint8_t ahInvert; // invert the artificial horizon
uint8_t osdProfileIndex;
uint8_t overlay_radio_mode;
char profile[OSD_PROFILE_COUNT][OSD_PROFILE_NAME_LENGTH + 1];

View file

@ -222,7 +222,6 @@
#define USE_CMS
#define USE_MSP_DISPLAYPORT
#define USE_MSP_OVER_TELEMETRY
#define USE_OSD_OVER_MSP_DISPLAYPORT
#define USE_LED_STRIP
#endif