refactor: replace psram allocations with standard heap

Signed-off-by: Bo <boironic@gmail.com>
This commit is contained in:
Bo
2026-02-19 15:05:00 +08:00
parent ce198ccbe8
commit 0c256d7653
5 changed files with 9 additions and 17 deletions

View File

@@ -7,7 +7,6 @@
#include "esp_log.h"
#include "esp_http_client.h"
#include "esp_crt_bundle.h"
#include "esp_heap_caps.h"
#include "nvs.h"
#include "cJSON.h"
@@ -256,9 +255,8 @@ esp_err_t tool_web_search_execute(const char *input_json, char *output, size_t o
snprintf(path, sizeof(path),
"/res/v1/web/search?q=%s&count=%d", encoded_query, SEARCH_RESULT_COUNT);
/* Allocate response buffer from PSRAM */
search_buf_t sb = {0};
sb.data = heap_caps_calloc(1, SEARCH_BUF_SIZE, MALLOC_CAP_SPIRAM);
sb.data = calloc(1, SEARCH_BUF_SIZE);
if (!sb.data) {
snprintf(output, output_size, "Error: Out of memory");
return ESP_ERR_NO_MEM;