2021-02-12 17:24:34 +00:00
|
|
|
#include "flipper.h"
|
|
|
|
#include <applications.h>
|
|
|
|
#include <furi.h>
|
2021-08-08 18:03:25 +00:00
|
|
|
#include <furi-hal-version.h>
|
2021-04-19 16:30:25 +00:00
|
|
|
|
2021-04-30 11:20:33 +00:00
|
|
|
static void flipper_print_version(const char* target, const Version* version) {
|
2021-04-19 16:30:25 +00:00
|
|
|
if(version) {
|
2021-04-30 11:20:33 +00:00
|
|
|
FURI_LOG_I(
|
|
|
|
"FLIPPER",
|
|
|
|
"\r\n\t%s version:\t%s\r\n"
|
|
|
|
"\tBuild date:\t\t%s\r\n"
|
|
|
|
"\tGit Commit:\t\t%s (%s)\r\n"
|
|
|
|
"\tGit Branch:\t\t%s",
|
|
|
|
target,
|
|
|
|
version_get_version(version),
|
|
|
|
version_get_builddate(version),
|
2021-04-19 16:30:25 +00:00
|
|
|
version_get_githash(version),
|
2021-04-30 11:20:33 +00:00
|
|
|
version_get_gitbranchnum(version),
|
|
|
|
version_get_gitbranch(version));
|
2021-04-19 16:30:25 +00:00
|
|
|
} else {
|
2021-04-30 11:20:33 +00:00
|
|
|
FURI_LOG_I("FLIPPER", "No build info for %s", target);
|
2021-04-19 16:30:25 +00:00
|
|
|
}
|
|
|
|
}
|
2021-02-12 17:24:34 +00:00
|
|
|
|
|
|
|
void flipper_init() {
|
2021-04-19 16:30:25 +00:00
|
|
|
const Version* version;
|
|
|
|
|
2021-10-26 12:24:14 +00:00
|
|
|
version = (const Version*)furi_hal_version_get_bootloader_version();
|
2021-04-30 11:20:33 +00:00
|
|
|
flipper_print_version("Bootloader", version);
|
2021-04-19 16:30:25 +00:00
|
|
|
|
2021-08-08 18:03:25 +00:00
|
|
|
version = (const Version*)furi_hal_version_get_firmware_version();
|
2021-04-30 11:20:33 +00:00
|
|
|
flipper_print_version("Firmware", version);
|
2021-02-12 17:24:34 +00:00
|
|
|
|
2021-04-30 11:20:33 +00:00
|
|
|
FURI_LOG_I("FLIPPER", "starting services");
|
2021-02-12 17:24:34 +00:00
|
|
|
|
|
|
|
for(size_t i = 0; i < FLIPPER_SERVICES_COUNT; i++) {
|
2021-04-30 11:20:33 +00:00
|
|
|
FURI_LOG_I("FLIPPER", "starting service %s", FLIPPER_SERVICES[i].name);
|
2021-02-12 17:24:34 +00:00
|
|
|
|
|
|
|
FuriThread* thread = furi_thread_alloc();
|
|
|
|
|
|
|
|
furi_thread_set_name(thread, FLIPPER_SERVICES[i].name);
|
|
|
|
furi_thread_set_stack_size(thread, FLIPPER_SERVICES[i].stack_size);
|
|
|
|
furi_thread_set_callback(thread, FLIPPER_SERVICES[i].app);
|
|
|
|
|
|
|
|
furi_thread_start(thread);
|
|
|
|
}
|
|
|
|
|
2021-04-30 11:20:33 +00:00
|
|
|
FURI_LOG_I("FLIPPER", "services startup complete");
|
2021-04-19 16:30:25 +00:00
|
|
|
}
|