fix: restore non-display psram usage and clean stale qrcode log

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

View File

@@ -7,6 +7,7 @@
#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"
@@ -90,7 +91,7 @@ typedef struct {
static esp_err_t resp_buf_init(resp_buf_t *rb, size_t initial_cap)
{
rb->data = calloc(1, initial_cap);
rb->data = heap_caps_calloc(1, initial_cap, MALLOC_CAP_SPIRAM);
if (!rb->data) return ESP_ERR_NO_MEM;
rb->len = 0;
rb->cap = initial_cap;
@@ -101,7 +102,7 @@ static esp_err_t resp_buf_append(resp_buf_t *rb, const char *data, size_t len)
{
while (rb->len + len >= rb->cap) {
size_t new_cap = rb->cap * 2;
char *tmp = realloc(rb->data, new_cap);
char *tmp = heap_caps_realloc(rb->data, new_cap, MALLOC_CAP_SPIRAM);
if (!tmp) return ESP_ERR_NO_MEM;
rb->data = tmp;
rb->cap = new_cap;