Merge pull request #9359 from mikeller/add_osd_to_status

Added OSD status to CLI 'status' output.
This commit is contained in:
Michael Keller 2020-01-16 12:54:11 +13:00 committed by GitHub
commit 54c8477b4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 24 additions and 12 deletions

View File

@ -4648,6 +4648,13 @@ static void cliStatus(char *cmdline)
cliPrintLinefeed();
#endif /* USE_SENSOR_NAMES */
#if defined(USE_OSD)
osdDisplayPortDevice_e displayPortDevice;
osdGetDisplayPort(&displayPortDevice);
cliPrintLinef("OSD: %s", lookupTableOsdDisplayPortDevice[displayPortDevice]);
#endif
// Uptime and wall clock
cliPrintf("System Uptime: %d seconds", millis() / 1000);

View File

@ -483,7 +483,7 @@ static const char* const lookupTableDshotBitbangedTimer[] = {
"AUTO", "TIM1", "TIM8"
};
static const char * const lookupTableOsdDisplayPortDevice[] = {
const char * const lookupTableOsdDisplayPortDevice[] = {
"NONE", "AUTO", "MAX7456", "MSP", "FRSKYOSD"
};

View File

@ -256,3 +256,5 @@ extern const char * const lookupTableRescueAltitudeMode[];
extern const char * const lookupTableItermRelax[];
extern const char * const lookupTableItermRelaxType[];
extern const char * const lookupTableOsdDisplayPortDevice[];

View File

@ -34,8 +34,7 @@ typedef struct crsfDisplayPortScreen_s {
bool reset;
} crsfDisplayPortScreen_t;
struct displayPort_s;
struct displayPort_s *displayPortCrsfInit(void);
displayPort_t *displayPortCrsfInit(void);
crsfDisplayPortScreen_t *crsfDisplayPortScreen(void);
void crsfDisplayPortMenuOpen(void);
void crsfDisplayPortMenuExit(void);

View File

@ -19,8 +19,7 @@
*/
#pragma once
#include "drivers/display.h"
#include "drivers/osd.h"
typedef struct displayPort_s displayPort_t;
displayPort_t *frskyOsdDisplayPortInit(const videoSystem_e videoSystem);

View File

@ -20,6 +20,8 @@
#pragma once
#include "drivers/display.h"
#include "pg/displayport_profiles.h"
struct displayPort_s *displayPortMspInit(void);
displayPort_t *displayPortMspInit(void);

View File

@ -22,6 +22,8 @@
#include "common/time.h"
#include "drivers/display.h"
#include "pg/pg.h"
#include "sensors/esc_sensor.h"
@ -319,8 +321,7 @@ extern float osdGForce;
extern escSensorData_t *osdEscDataCombined;
#endif
struct displayPort_s;
void osdInit(struct displayPort_s *osdDisplayPort, osdDisplayPortDevice_e displayPortDevice);
void osdInit(displayPort_t *osdDisplayPort, osdDisplayPortDevice_e displayPortDevice);
bool osdInitialized(void);
void osdUpdate(timeUs_t currentTimeUs);
void osdStatSetState(uint8_t statIndex, bool enabled);
@ -336,4 +337,4 @@ bool osdElementVisible(uint16_t value);
bool osdGetVisualBeeperState(void);
statistic_t *osdGetStats(void);
bool osdNeedsAccelerometer(void);
struct displayPort_s *osdGetDisplayPort(osdDisplayPortDevice_e *displayPortDevice);
displayPort_t *osdGetDisplayPort(osdDisplayPortDevice_e *displayPortDevice);

View File

@ -65,6 +65,7 @@ extern "C" {
};
const uint16_t valueTableEntryCount = ARRAYLEN(valueTable);
const lookupTableEntry_t lookupTables[] = {};
const char * const lookupTableOsdDisplayPortDevice[] = {};
PG_REGISTER(osdConfig_t, osdConfig, PG_OSD_CONFIG, 0);
@ -342,9 +343,9 @@ void serialSetCtrlLineState(serialPort_t *, uint16_t ) {}
void serialSetBaudRateCb(serialPort_t *, void (*)(serialPort_t *context, uint32_t baud), serialPort_t *) {}
char *getBoardName(void) { return NULL; };
char *getManufacturerId(void) { return NULL; };
bool boardInformationIsSet(void) { return true; };
char *getBoardName(void) { return NULL; }
char *getManufacturerId(void) { return NULL; }
bool boardInformationIsSet(void) { return true; }
bool setBoardName(char *newBoardName) { UNUSED(newBoardName); return true; };
bool setManufacturerId(char *newManufacturerId) { UNUSED(newManufacturerId); return true; };
@ -355,4 +356,5 @@ void analyzeModeActivationConditions(void) {}
bool isModeActivationConditionConfigured(const modeActivationCondition_t *, const modeActivationCondition_t *) { return false; }
void delay(uint32_t) {}
displayPort_t *osdGetDisplayPort(osdDisplayPortDevice_e *) { return NULL; }
}