From 887c3155c2946d9e334fd3d8dbca159a742d1c42 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Mon, 1 Apr 2024 00:53:18 +0200 Subject: [PATCH] Refining watchdog --- esphome/nspanel_esphome_core.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index a602e6a..b9d31e8 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -3157,10 +3157,16 @@ script: size_t total_heap_size = heap_caps_get_total_size(MALLOC_CAP_DEFAULT); size_t free_heap_size = esp_get_free_heap_size(); #endif - if (total_heap_size != 0) - ESP_LOGI(TAG, " Heap: %zu bytes (%d%%)", free_heap_size, + if (total_heap_size != 0) { + std::string numStr = std::to_string(free_heap_size); + int insertPosition = numStr.length() - 3; + while (insertPosition > 0) { + numStr.insert(insertPosition, " "); + insertPosition -= 3; + } + ESP_LOGI(TAG, " Free heap: %s bytes (%d%%)", numStr.c_str(), int(round(((float)free_heap_size / total_heap_size) * 100.0f))); - + } // Report UART ESP_LOGI(TAG, "UART:"); ESP_LOGI(TAG, " Baud rate: %" PRIu32 " bps", tf_uart->get_baud_rate());