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

Enable retrieval of the BUILD_KEY using MSP2 (#12264)

* Enable retrieval of the BUILD_KEY using MSP2

* Repositioning
This commit is contained in:
J Blackman 2023-02-01 03:50:55 +11:00 committed by GitHub
parent 395e8e8983
commit 7604b05a00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 2 deletions

View file

@ -26,3 +26,9 @@ const char * const targetName = __TARGET__;
const char * const shortGitRevision = __REVISION__;
const char * const buildDate = __DATE__;
const char * const buildTime = __TIME__;
#ifdef BUILD_KEY
const char * const buildKey = STR(BUILD_KEY);
#else
const char * const buildKey = " ";
#endif

View file

@ -42,3 +42,5 @@ extern const char* const buildDate; // "MMM DD YYYY" MMM = Jan/Feb/...
extern const char* const buildTime; // "HH:MM:SS"
#define MSP_API_VERSION_STRING STR(API_VERSION_MAJOR) "." STR(API_VERSION_MINOR)
extern const char* const buildKey;

View file

@ -4815,7 +4815,7 @@ static void cliStatus(const char *cmdName, char *cmdline)
#endif
#ifdef BUILD_KEY
cliPrintf("BUILD KEY: %s", STR(BUILD_KEY));
cliPrintf("BUILD KEY: %s", buildKey);
#ifdef RELEASE_NAME
cliPrintf(" (%s)", STR(RELEASE_NAME));
#endif

View file

@ -2522,7 +2522,7 @@ static mspResult_e mspFcProcessOutCommandWithArg(mspDescriptor_t srcDesc, int16_
// type byte, then length byte followed by the actual characters
const uint8_t textType = sbufBytesRemaining(src) ? sbufReadU8(src) : 0;
char* textVar;
const char *textVar;
switch (textType) {
case MSP2TEXT_PILOT_NAME:
@ -2541,6 +2541,10 @@ static mspResult_e mspFcProcessOutCommandWithArg(mspDescriptor_t srcDesc, int16_
textVar = currentControlRateProfile->profileName;
break;
case MSP2TEXT_BUILDKEY:
textVar = buildKey;
break;
default:
return MSP_RESULT_ERROR;
}

View file

@ -32,3 +32,4 @@
#define MSP2TEXT_CRAFT_NAME 2
#define MSP2TEXT_PID_PROFILE_NAME 3
#define MSP2TEXT_RATE_PROFILE_NAME 4
#define MSP2TEXT_BUILDKEY 5