feat: integrate MCP and ES3C28P audio support with upstream compatibility updates
This commit is contained in:
@@ -10,8 +10,19 @@
|
||||
|
||||
constexpr auto* TAG = "Tactility";
|
||||
|
||||
#include <cJSON.h>
|
||||
#include <esp_heap_caps.h>
|
||||
|
||||
namespace tt {
|
||||
|
||||
static void* cjson_psram_malloc(size_t size) {
|
||||
return heap_caps_malloc(size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
||||
}
|
||||
|
||||
static void cjson_psram_free(void* ptr) {
|
||||
heap_caps_free(ptr);
|
||||
}
|
||||
|
||||
static void initNetwork() {
|
||||
LOG_I(TAG, "Init network");
|
||||
ESP_ERROR_CHECK(esp_netif_init());
|
||||
@@ -19,6 +30,13 @@ static void initNetwork() {
|
||||
}
|
||||
|
||||
void initEsp() {
|
||||
cJSON_Hooks hooks = {
|
||||
.malloc_fn = cjson_psram_malloc,
|
||||
.free_fn = cjson_psram_free
|
||||
};
|
||||
cJSON_InitHooks(&hooks);
|
||||
LOG_I(TAG, "cJSON hooks initialized to use PSRAM");
|
||||
|
||||
check(initPartitionsEsp(), "Failed to init partitions");
|
||||
initNetwork();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user