2021-04-19 16:30:25 +00:00
|
|
|
#include "version.h"
|
|
|
|
|
2022-06-26 12:00:03 +00:00
|
|
|
/* This header is autogenerated by build system */
|
|
|
|
#include "version.inc.h"
|
|
|
|
|
2021-04-19 16:30:25 +00:00
|
|
|
struct Version {
|
2022-01-05 16:10:18 +00:00
|
|
|
const char* git_hash;
|
|
|
|
const char* git_branch;
|
|
|
|
const char* git_branch_num;
|
|
|
|
const char* build_date;
|
2022-08-14 02:34:54 +00:00
|
|
|
const char* custom_flipper_name;
|
2022-01-05 16:10:18 +00:00
|
|
|
const char* version;
|
2021-10-16 11:25:32 +00:00
|
|
|
const uint8_t target;
|
2022-04-13 20:50:25 +00:00
|
|
|
const bool build_is_dirty;
|
2021-04-19 16:30:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* version of current running firmware (bootloader/flipper) */
|
|
|
|
static const Version version = {
|
2022-01-05 16:10:18 +00:00
|
|
|
.git_hash = GIT_COMMIT,
|
|
|
|
.git_branch = GIT_BRANCH,
|
2021-04-19 16:30:25 +00:00
|
|
|
.git_branch_num = GIT_BRANCH_NUM,
|
2022-01-05 16:10:18 +00:00
|
|
|
.build_date = BUILD_DATE,
|
2022-08-14 02:34:54 +00:00
|
|
|
#ifdef FURI_CUSTOM_FLIPPER_NAME
|
|
|
|
.custom_flipper_name = FURI_CUSTOM_FLIPPER_NAME,
|
|
|
|
#else
|
|
|
|
.custom_flipper_name = NULL,
|
|
|
|
#endif
|
2022-04-13 20:50:25 +00:00
|
|
|
.version = VERSION
|
|
|
|
#ifdef FURI_RAM_EXEC
|
|
|
|
" (RAM)"
|
|
|
|
#endif
|
|
|
|
,
|
2022-01-05 16:10:18 +00:00
|
|
|
.target = TARGET,
|
2022-04-13 20:50:25 +00:00
|
|
|
.build_is_dirty = BUILD_DIRTY,
|
2021-04-19 16:30:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const Version* version_get(void) {
|
|
|
|
return &version;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* version_get_githash(const Version* v) {
|
|
|
|
return v ? v->git_hash : version.git_hash;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* version_get_gitbranch(const Version* v) {
|
|
|
|
return v ? v->git_branch : version.git_branch;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* version_get_gitbranchnum(const Version* v) {
|
|
|
|
return v ? v->git_branch_num : version.git_branch_num;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* version_get_builddate(const Version* v) {
|
|
|
|
return v ? v->build_date : version.build_date;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* version_get_version(const Version* v) {
|
|
|
|
return v ? v->version : version.version;
|
|
|
|
}
|
|
|
|
|
2022-08-14 02:34:54 +00:00
|
|
|
const char* version_get_custom_name(const Version* v) {
|
|
|
|
return v ? v->custom_flipper_name : version.custom_flipper_name;
|
|
|
|
}
|
|
|
|
|
2022-04-13 20:50:25 +00:00
|
|
|
uint8_t version_get_target(const Version* v) {
|
2021-04-19 16:30:25 +00:00
|
|
|
return v ? v->target : version.target;
|
|
|
|
}
|
2022-04-13 20:50:25 +00:00
|
|
|
|
|
|
|
bool version_get_dirty_flag(const Version* v) {
|
|
|
|
return v ? v->build_is_dirty : version.build_is_dirty;
|
2022-05-06 13:37:10 +00:00
|
|
|
}
|