Ken Van Hoeylandt f4088f5762 various improvements
stopped using private header folder (for ease of development - for now)
implemented basic gui service (WIP)
added sdkconfig.defaults to the repo
updated docs
2023-12-27 13:57:20 +01:00

39 lines
1.1 KiB
C

#include "system_info.h"
#include "nanobake.h"
#include <core_defines.h>
#include <thread.h>
static int32_t system_info_entry_point(void* param) {
UNUSED(param);
// Wait for all apps to start
vTaskDelay(1000 / portTICK_PERIOD_MS);
size_t system_service_count = nanobake_get_app_thread_count();
printf("Running apps:\n");
for (int i = 0; i < system_service_count; ++i) {
FuriThreadId thread_id = nanobake_get_app_thread_id(i);
const char* appid = furi_thread_get_appid(thread_id);
const char* name = furi_thread_get_name(thread_id);
bool is_suspended = furi_thread_is_suspended(thread_id);
const char* status = is_suspended ? "suspended" : "active";
printf(" - [%s] %s (%s)\n", status, name, appid);
}
printf("Heap memory available: %d / %d\n",
heap_caps_get_free_size(MALLOC_CAP_DEFAULT),
heap_caps_get_total_size(MALLOC_CAP_DEFAULT)
);
return 0;
}
nb_app_t system_info_app = {
.id = "systeminfo",
.name = "System Info",
.type = SYSTEM,
.entry_point = &system_info_entry_point,
.stack_size = 2048,
.priority = 10
};