[FL-164] Add bootloader version (#417)

* Add bootloader versioning
* Move some logic to api-hal-version
* Backport to f4
* Dolphin: update version screen layout, make it more readable

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Albert Kharisov
2021-04-19 19:30:25 +03:00
committed by GitHub
parent 202673aed1
commit aa20a78b0e
21 changed files with 320 additions and 27 deletions

View File

@@ -1,5 +1,7 @@
#include "cli_i.h"
#include "cli_commands.h"
#include <version.h>
#include <api-hal-version.h>
Cli* cli_alloc() {
Cli* cli = furi_alloc(sizeof(Cli));
@@ -48,16 +50,31 @@ size_t cli_read(Cli* cli, uint8_t* buffer, size_t size) {
return api_hal_vcp_rx(buffer, size);
}
void cli_print_version() {
printf("Build date:" BUILD_DATE ". "
"Git Commit:" GIT_COMMIT ". "
"Git Branch:" GIT_BRANCH ". "
"Commit Number:" GIT_BRANCH_NUM ".");
void cli_print_version(const Version* version) {
if(version) {
printf("\tVersion:\t%s\r\n", version_get_version(version));
printf("\tBuild date:\t%s\r\n", version_get_builddate(version));
printf(
"\tGit Commit:\t%s (%s)\r\n",
version_get_githash(version),
version_get_gitbranchnum(version));
printf("\tGit Branch:\t%s\r\n", version_get_gitbranch(version));
} else {
printf("\tNo build info\r\n");
}
}
void cli_motd() {
const Version* version;
printf("Flipper cli.\r\n");
cli_print_version();
version = (const Version*)api_hal_version_get_boot_version();
printf("Bootloader\r\n");
cli_print_version(version);
version = (const Version*)api_hal_version_get_fw_version();
printf("Firmware\r\n");
cli_print_version(version);
}
void cli_nl() {