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:
parent
395e8e8983
commit
7604b05a00
5 changed files with 15 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue