mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 11:59:58 +03:00
Enables retrieval of the RELEASE_NAME using MSP2 (#12878)
Retrieve releasename
This commit is contained in:
parent
16776dc29f
commit
7d1007ea03
6 changed files with 24 additions and 9 deletions
|
@ -30,8 +30,14 @@ const char * const shortConfigGitRevision = __CONFIG_REVISION__;
|
||||||
const char * const buildDate = __DATE__;
|
const char * const buildDate = __DATE__;
|
||||||
const char * const buildTime = __TIME__;
|
const char * const buildTime = __TIME__;
|
||||||
|
|
||||||
#if defined(BUILD_KEY)
|
#ifdef BUILD_KEY
|
||||||
const char * const buildKey = STR(BUILD_KEY);
|
const char * const buildKey = STR(BUILD_KEY);
|
||||||
#else
|
#else
|
||||||
const char * const buildKey = " ";
|
const char * const buildKey = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BUILD_KEY) && defined(RELEASE_NAME)
|
||||||
|
const char * const releaseName = STR(RELEASE_NAME);
|
||||||
|
#else
|
||||||
|
const char * const releaseName = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -47,3 +47,4 @@ extern const char* const buildTime; // "HH:MM:SS"
|
||||||
#define MSP_API_VERSION_STRING STR(API_VERSION_MAJOR) "." STR(API_VERSION_MINOR)
|
#define MSP_API_VERSION_STRING STR(API_VERSION_MAJOR) "." STR(API_VERSION_MINOR)
|
||||||
|
|
||||||
extern const char* const buildKey;
|
extern const char* const buildKey;
|
||||||
|
extern const char* const releaseName;
|
||||||
|
|
|
@ -4728,14 +4728,13 @@ static void cliStatus(const char *cmdName, char *cmdline)
|
||||||
cliPrintLinef("OSD: %s (%u x %u)", lookupTableOsdDisplayPortDevice[displayPortDeviceType], osdDisplayPort->cols, osdDisplayPort->rows);
|
cliPrintLinef("OSD: %s (%u x %u)", lookupTableOsdDisplayPortDevice[displayPortDeviceType], osdDisplayPort->cols, osdDisplayPort->rows);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BUILD_KEY
|
if (buildKey) {
|
||||||
cliPrintf("BUILD KEY: %s", buildKey);
|
cliPrintf("BUILD KEY: %s", buildKey);
|
||||||
#ifdef RELEASE_NAME
|
if (releaseName) {
|
||||||
cliPrintf(" (%s)", STR(RELEASE_NAME));
|
cliPrintf(" (%s)", releaseName);
|
||||||
#endif
|
}
|
||||||
cliPrintLinefeed();
|
cliPrintLinefeed();
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// Uptime and wall clock
|
// Uptime and wall clock
|
||||||
|
|
||||||
cliPrintf("System Uptime: %d seconds", millis() / 1000);
|
cliPrintf("System Uptime: %d seconds", millis() / 1000);
|
||||||
|
|
|
@ -2551,10 +2551,16 @@ static mspResult_e mspFcProcessOutCommandWithArg(mspDescriptor_t srcDesc, int16_
|
||||||
textVar = buildKey;
|
textVar = buildKey;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MSP2TEXT_RELEASENAME:
|
||||||
|
textVar = releaseName;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return MSP_RESULT_ERROR;
|
return MSP_RESULT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!textVar) return MSP_RESULT_ERROR;
|
||||||
|
|
||||||
const uint8_t textLength = strlen(textVar);
|
const uint8_t textLength = strlen(textVar);
|
||||||
|
|
||||||
// type byte, then length byte followed by the actual characters
|
// type byte, then length byte followed by the actual characters
|
||||||
|
|
|
@ -33,3 +33,4 @@
|
||||||
#define MSP2TEXT_PID_PROFILE_NAME 3
|
#define MSP2TEXT_PID_PROFILE_NAME 3
|
||||||
#define MSP2TEXT_RATE_PROFILE_NAME 4
|
#define MSP2TEXT_RATE_PROFILE_NAME 4
|
||||||
#define MSP2TEXT_BUILDKEY 5
|
#define MSP2TEXT_BUILDKEY 5
|
||||||
|
#define MSP2TEXT_RELEASENAME 6
|
||||||
|
|
|
@ -68,6 +68,8 @@ 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[] = {};
|
const char * const lookupTableOsdDisplayPortDevice[] = {};
|
||||||
|
const char * const buildKey = NULL;
|
||||||
|
const char * const releaseName = NULL;
|
||||||
|
|
||||||
|
|
||||||
PG_REGISTER(osdConfig_t, osdConfig, PG_OSD_CONFIG, 0);
|
PG_REGISTER(osdConfig_t, osdConfig, PG_OSD_CONFIG, 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue