1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 03:50:02 +03:00

Added OSD status to CLI 'status' output.

This commit is contained in:
Michael Keller 2020-01-14 13:53:15 +13:00 committed by mikeller
parent f53d812fc8
commit 099e0a6064
8 changed files with 24 additions and 12 deletions

View file

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

View file

@ -483,7 +483,7 @@ static const char* const lookupTableDshotBitbangedTimer[] = {
"AUTO", "TIM1", "TIM8" "AUTO", "TIM1", "TIM8"
}; };
static const char * const lookupTableOsdDisplayPortDevice[] = { const char * const lookupTableOsdDisplayPortDevice[] = {
"NONE", "AUTO", "MAX7456", "MSP", "FRSKYOSD" "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 lookupTableItermRelax[];
extern const char * const lookupTableItermRelaxType[]; extern const char * const lookupTableItermRelaxType[];
extern const char * const lookupTableOsdDisplayPortDevice[];

View file

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

View file

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

View file

@ -20,6 +20,8 @@
#pragma once #pragma once
#include "drivers/display.h"
#include "pg/displayport_profiles.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 "common/time.h"
#include "drivers/display.h"
#include "pg/pg.h" #include "pg/pg.h"
#include "sensors/esc_sensor.h" #include "sensors/esc_sensor.h"
@ -319,8 +321,7 @@ extern float osdGForce;
extern escSensorData_t *osdEscDataCombined; extern escSensorData_t *osdEscDataCombined;
#endif #endif
struct displayPort_s; void osdInit(displayPort_t *osdDisplayPort, osdDisplayPortDevice_e displayPortDevice);
void osdInit(struct displayPort_s *osdDisplayPort, osdDisplayPortDevice_e displayPortDevice);
bool osdInitialized(void); bool osdInitialized(void);
void osdUpdate(timeUs_t currentTimeUs); void osdUpdate(timeUs_t currentTimeUs);
void osdStatSetState(uint8_t statIndex, bool enabled); void osdStatSetState(uint8_t statIndex, bool enabled);
@ -336,4 +337,4 @@ bool osdElementVisible(uint16_t value);
bool osdGetVisualBeeperState(void); bool osdGetVisualBeeperState(void);
statistic_t *osdGetStats(void); statistic_t *osdGetStats(void);
bool osdNeedsAccelerometer(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 uint16_t valueTableEntryCount = ARRAYLEN(valueTable);
const lookupTableEntry_t lookupTables[] = {}; const lookupTableEntry_t lookupTables[] = {};
const char * const lookupTableOsdDisplayPortDevice[] = {};
PG_REGISTER(osdConfig_t, osdConfig, PG_OSD_CONFIG, 0); 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 *) {} void serialSetBaudRateCb(serialPort_t *, void (*)(serialPort_t *context, uint32_t baud), serialPort_t *) {}
char *getBoardName(void) { return NULL; }; char *getBoardName(void) { return NULL; }
char *getManufacturerId(void) { return NULL; }; char *getManufacturerId(void) { return NULL; }
bool boardInformationIsSet(void) { return true; }; bool boardInformationIsSet(void) { return true; }
bool setBoardName(char *newBoardName) { UNUSED(newBoardName); return true; }; bool setBoardName(char *newBoardName) { UNUSED(newBoardName); return true; };
bool setManufacturerId(char *newManufacturerId) { UNUSED(newManufacturerId); 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; } bool isModeActivationConditionConfigured(const modeActivationCondition_t *, const modeActivationCondition_t *) { return false; }
void delay(uint32_t) {} void delay(uint32_t) {}
displayPort_t *osdGetDisplayPort(osdDisplayPortDevice_e *) { return NULL; }
} }