bugfix(c_speech_feature): alloc from SRAM when PSRAM is disabled

This commit is contained in:
xysun 2023-10-23 15:50:57 +08:00
parent d05f268bae
commit 7b43d3706a
6 changed files with 5 additions and 1 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -277,7 +277,11 @@ void esp_mn_active_commands_print(void)
void *_esp_mn_calloc_(int n, int size) void *_esp_mn_calloc_(int n, int size)
{ {
#ifdef ESP_PLATFORM #ifdef ESP_PLATFORM
return heap_caps_calloc(n, size, MALLOC_CAP_SPIRAM); void *data = heap_caps_calloc(n, size, MALLOC_CAP_SPIRAM);
if (data == NULL) {
data = calloc(n, size);
}
return data;
#else #else
return calloc(n, size); return calloc(n, size);
#endif #endif