allow setting custom flipper name

serial & ble mac generated from custom name (if set), CI support added too
This commit is contained in:
MX
2022-08-14 05:34:54 +03:00
parent 4dab3a83a3
commit a896aa4113
7 changed files with 81 additions and 12 deletions
+10
View File
@@ -8,6 +8,7 @@ struct Version {
const char* git_branch;
const char* git_branch_num;
const char* build_date;
const char* custom_flipper_name;
const char* version;
const uint8_t target;
const bool build_is_dirty;
@@ -19,6 +20,11 @@ static const Version version = {
.git_branch = GIT_BRANCH,
.git_branch_num = GIT_BRANCH_NUM,
.build_date = BUILD_DATE,
#ifdef FURI_CUSTOM_FLIPPER_NAME
.custom_flipper_name = FURI_CUSTOM_FLIPPER_NAME,
#else
.custom_flipper_name = NULL,
#endif
.version = VERSION
#ifdef FURI_RAM_EXEC
" (RAM)"
@@ -52,6 +58,10 @@ const char* version_get_version(const Version* v) {
return v ? v->version : version.version;
}
const char* version_get_custom_name(const Version* v) {
return v ? v->custom_flipper_name : version.custom_flipper_name;
}
uint8_t version_get_target(const Version* v) {
return v ? v->target : version.target;
}
+10
View File
@@ -2,6 +2,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
@@ -64,6 +65,15 @@ const char* version_get_builddate(const Version* v);
*/
const char* version_get_version(const Version* v);
/** Get custom flipper name if set in ENV
*
* @param v pointer to Version data. NULL for currently running
* software.
*
* @return custom name or NULL
*/
const char* version_get_custom_name(const Version* v);
/** Get hardware target this firmware was built for
*
* @param v pointer to Version data. NULL for currently running