From 8a60a15682d0dfa76d12611a8fa7494d3a0748a6 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Sat, 13 Apr 2024 02:06:13 +0200 Subject: [PATCH] Remove psram code when psram is not included --- esphome/nspanel_esphome_core.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index c045aa5..ba74cc6 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -3277,8 +3277,6 @@ script: // Report memory const size_t internal_heap_size = heap_caps_get_total_size(MALLOC_CAP_INTERNAL); const size_t internal_heap_size_free = heap_caps_get_free_size(MALLOC_CAP_INTERNAL); - const size_t psram_heap_size = heap_caps_get_total_size(MALLOC_CAP_SPIRAM); - const size_t psram_heap_size_free = heap_caps_get_free_size(MALLOC_CAP_SPIRAM); ESP_LOGI(TAG, " Free heap:"); if (internal_heap_size != 0) { @@ -3288,12 +3286,17 @@ script: ESP_LOGI(TAG, " Internal: %7d bytes", internal_heap_size_free); } + #ifdef USE_PSRAM + const size_t psram_heap_size = heap_caps_get_total_size(MALLOC_CAP_SPIRAM); + const size_t psram_heap_size_free = heap_caps_get_free_size(MALLOC_CAP_SPIRAM); if (psram_heap_size != 0) { ESP_LOGI(TAG, " PSRAM: %7d bytes (%0.1f%%)", psram_heap_size_free, ((float)psram_heap_size_free / psram_heap_size) * 100.0f); } else { ESP_LOGI(TAG, " PSRAM: %7d bytes", psram_heap_size_free); } + #endif + // Report UART ESP_LOGI(TAG, "UART:"); ESP_LOGI(TAG, " Baud rate: %" PRIu32 " bps", tf_uart->get_baud_rate());