2021-04-19 19:30:25 +03:00
|
|
|
#include "version.h"
|
|
|
|
|
|
|
|
struct Version {
|
2022-01-05 19:10:18 +03:00
|
|
|
const char* git_hash;
|
|
|
|
const char* git_branch;
|
|
|
|
const char* git_branch_num;
|
|
|
|
const char* build_date;
|
|
|
|
const char* version;
|
2021-10-16 14:25:32 +03:00
|
|
|
const uint8_t target;
|
2021-04-19 19:30:25 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/* version of current running firmware (bootloader/flipper) */
|
|
|
|
static const Version version = {
|
2022-01-05 19:10:18 +03:00
|
|
|
.git_hash = GIT_COMMIT,
|
|
|
|
.git_branch = GIT_BRANCH,
|
2021-04-19 19:30:25 +03:00
|
|
|
.git_branch_num = GIT_BRANCH_NUM,
|
2022-01-05 19:10:18 +03:00
|
|
|
.build_date = BUILD_DATE,
|
|
|
|
.version = VERSION,
|
|
|
|
.target = TARGET,
|
2021-04-19 19:30:25 +03: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;
|
|
|
|
}
|
|
|
|
|
2021-10-16 14:25:32 +03:00
|
|
|
const uint8_t version_get_target(const Version* v) {
|
2021-04-19 19:30:25 +03:00
|
|
|
return v ? v->target : version.target;
|
|
|
|
}
|