Ken Van Hoeylandt 0188ce721c
Boot splash and more (#98)
* Boot splash and more

- Added developer sdkconfig
- Refactored the way FreeRTOS includes are included
- Improved Gui/Loader logic
- Implemented boot app with splash screen

* Updated naming for Gui and Loader services

* Renamed Screenshot service methods

* Renames

* Service renames
2024-11-30 15:37:16 +01:00

38 lines
1.3 KiB
C++

#include "Check.h"
#include "CoreDefines.h"
#include "Log.h"
#include "RtosCompatTask.h"
#define TAG "kernel"
static void tt_print_memory_info() {
#ifdef ESP_PLATFORM
TT_LOG_E(TAG, "default caps:");
TT_LOG_E(TAG, " total: %u", heap_caps_get_total_size(MALLOC_CAP_DEFAULT));
TT_LOG_E(TAG, " free: %u", heap_caps_get_free_size(MALLOC_CAP_DEFAULT));
TT_LOG_E(TAG, " min free: %u", heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT));
TT_LOG_E(TAG, "internal caps:");
TT_LOG_E(TAG, " total: %u", heap_caps_get_total_size(MALLOC_CAP_INTERNAL));
TT_LOG_E(TAG, " free: %u", heap_caps_get_free_size(MALLOC_CAP_INTERNAL));
TT_LOG_E(TAG, " min free: %u", heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL));
#endif
}
static void tt_print_task_info() {
const char* name = pcTaskGetName(nullptr);
const char* safe_name = name ? name : "main";
TT_LOG_E(TAG, "Task: %s", safe_name);
TT_LOG_E(TAG, "Stack watermark: %u", uxTaskGetStackHighWaterMark(NULL) * 4);
}
TT_NORETURN void tt_crash_implementation() {
tt_print_task_info();
tt_print_memory_info();
// TODO: Add breakpoint when debugger is attached.
#ifdef ESP_TARGET
esp_system_abort("System halted. Connect debugger for more info.");
#endif
__builtin_unreachable();
}