1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-27 05:03:48 +00:00

use PRIx macros for printing u32/i32 ints (#4671)

This fix compilation issues with the latest esp-idf.
This commit is contained in:
Jörg Thalheim
2023-04-10 23:20:02 +01:00
committed by GitHub
parent b56fa8c50a
commit 421ebcc8b2
9 changed files with 27 additions and 18 deletions

View File

@@ -1,4 +1,5 @@
#include "logger.h"
#include <cinttypes>
#ifdef USE_ESP_IDF
#include <driver/uart.h>
@@ -292,7 +293,7 @@ const char *const UART_SELECTIONS[] = {"UART0", "UART1", "USB_CDC"};
void Logger::dump_config() {
ESP_LOGCONFIG(TAG, "Logger:");
ESP_LOGCONFIG(TAG, " Level: %s", LOG_LEVELS[ESPHOME_LOG_LEVEL]);
ESP_LOGCONFIG(TAG, " Log Baud Rate: %u", this->baud_rate_);
ESP_LOGCONFIG(TAG, " Log Baud Rate: %" PRIu32, this->baud_rate_);
ESP_LOGCONFIG(TAG, " Hardware UART: %s", UART_SELECTIONS[this->uart_]);
for (auto &it : this->log_levels_) {
ESP_LOGCONFIG(TAG, " Level for '%s': %s", it.tag.c_str(), LOG_LEVELS[it.level]);