Refining watchdog
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user