bolar_2 backup

This commit is contained in:
2026-11-27 16:38:11 +08:00
commit e96d6d19df
305 changed files with 43350 additions and 0 deletions

41
main/main.cc Normal file
View File

@@ -0,0 +1,41 @@
#include "app/composition_root.h"
#include "diagnostics/device_log_formatter.h"
#include <esp_heap_caps.h>
#include <esp_log.h>
#include <cJSON.h>
namespace {
constexpr const char* kTag = "BorlaFirmware2";
void* PsramCjsonMalloc(size_t size)
{
return heap_caps_malloc(size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
}
void PsramCjsonFree(void* pointer)
{
heap_caps_free(pointer);
}
} // namespace
extern "C" void app_main()
{
cJSON_Hooks cjson_hooks = {
PsramCjsonMalloc,
PsramCjsonFree,
};
cJSON_InitHooks(&cjson_hooks);///修复:全局 cJSON 钩子指向 PSRAM,防止WiFi mem fail
const bool log_identity_ready = borla::DeviceLogFormatter::Initialize();
ESP_LOGI(kTag, "starting firmware2 control and playback foundation");
if (!log_identity_ready) {
ESP_LOGW(kTag, "device MAC unavailable for log prefix");
}
static borla::CompositionRoot root;
if (!root.Initialize()) {
ESP_LOGE(kTag, "initialization incomplete; entering fault-capable loop");
}
root.Run();
}