Ken Van Hoeylandt 9a11e6f47b
Implement UI scaling and more (#501)
**New Features**
 * Runtime font accessors and new symbol fonts for text, launcher, statusbar, and shared icons.
 * Added font height base setting to device.properties
 * Text fonts now have 3 sizes: small, default, large

**Improvements**
 * Renamed `UiScale` to `UiDensity`
 * Statusbar, toolbar and many UI components now compute heights and spacing from fonts/density.
 * SSD1306 initialization sequence refined for more stable startup.
 * Multiple image assets replaced by symbol-font rendering.
 * Many layout improvements related to density, font scaling and icon scaling
 * Updated folder name capitalization for newer style
2026-02-15 01:41:47 +01:00

41 lines
1.4 KiB
C++

#include <cstdlib>
#include <tactility/freertos/task.h>
#include <tactility/log.h>
static const auto* TAG = "Kernel";
static void log_memory_info() {
#ifdef ESP_PLATFORM
LOG_E(TAG, "Default memory caps:");
LOG_E(TAG, " Total: %" PRIu64, static_cast<uint64_t>(heap_caps_get_total_size(MALLOC_CAP_DEFAULT)));
LOG_E(TAG, " Free: %" PRIu64, static_cast<uint64_t>(heap_caps_get_free_size(MALLOC_CAP_DEFAULT)));
LOG_E(TAG, " Min free: %" PRIu64, static_cast<uint64_t>(heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT)));
LOG_E(TAG, "Internal memory caps:");
LOG_E(TAG, " Total: %" PRIu64, static_cast<uint64_t>(heap_caps_get_total_size(MALLOC_CAP_INTERNAL)));
LOG_E(TAG, " Free: %" PRIu64, static_cast<uint64_t>(heap_caps_get_free_size(MALLOC_CAP_INTERNAL)));
LOG_E(TAG, " Min free: %" PRIu64, static_cast<uint64_t>(heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL)));
#endif
}
static void log_task_info() {
const char* name = pcTaskGetName(nullptr);
const char* safe_name = name ? name : "main";
LOG_E(TAG, "Task: %s", safe_name);
}
extern "C" {
__attribute__((noreturn)) void __crash(void) {
log_task_info();
log_memory_info();
// TODO: Add breakpoint when debugger is attached.
#ifdef ESP_PLATFORM
esp_system_abort("System halted. Connect debugger for more info.");
#else
exit(1);
#endif
__builtin_unreachable();
}
}