From e8972c65c8a654092068aca12922efc7ced80c4c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 22 Jan 2026 12:53:15 -1000 Subject: [PATCH] [mipi_rgb] Fix dump_summary deprecation warning (#13463) --- esphome/components/mipi_rgb/mipi_rgb.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/esphome/components/mipi_rgb/mipi_rgb.cpp b/esphome/components/mipi_rgb/mipi_rgb.cpp index ef96da8a1c..d0e716bd24 100644 --- a/esphome/components/mipi_rgb/mipi_rgb.cpp +++ b/esphome/components/mipi_rgb/mipi_rgb.cpp @@ -1,9 +1,11 @@ #ifdef USE_ESP32_VARIANT_ESP32S3 #include "mipi_rgb.h" +#include "esphome/core/gpio.h" +#include "esphome/core/hal.h" #include "esphome/core/helpers.h" #include "esphome/core/log.h" -#include "esphome/core/hal.h" #include "esp_lcd_panel_rgb.h" +#include namespace esphome { namespace mipi_rgb { @@ -343,19 +345,27 @@ int MipiRgb::get_height() { } } -static std::string get_pin_name(GPIOPin *pin) { +static const char *get_pin_name(GPIOPin *pin, std::span buffer) { if (pin == nullptr) return "None"; - return pin->dump_summary(); + pin->dump_summary(buffer.data(), buffer.size()); + return buffer.data(); } void MipiRgb::dump_pins_(uint8_t start, uint8_t end, const char *name, uint8_t offset) { + char pin_summary[GPIO_SUMMARY_MAX_LEN]; for (uint8_t i = start; i != end; i++) { - ESP_LOGCONFIG(TAG, " %s pin %d: %s", name, offset++, this->data_pins_[i]->dump_summary().c_str()); + this->data_pins_[i]->dump_summary(pin_summary, sizeof(pin_summary)); + ESP_LOGCONFIG(TAG, " %s pin %d: %s", name, offset++, pin_summary); } } void MipiRgb::dump_config() { + char reset_buf[GPIO_SUMMARY_MAX_LEN]; + char de_buf[GPIO_SUMMARY_MAX_LEN]; + char pclk_buf[GPIO_SUMMARY_MAX_LEN]; + char hsync_buf[GPIO_SUMMARY_MAX_LEN]; + char vsync_buf[GPIO_SUMMARY_MAX_LEN]; ESP_LOGCONFIG(TAG, "MIPI_RGB LCD" "\n Model: %s" @@ -379,9 +389,9 @@ void MipiRgb::dump_config() { this->model_, this->width_, this->height_, this->rotation_, YESNO(this->pclk_inverted_), this->hsync_pulse_width_, this->hsync_back_porch_, this->hsync_front_porch_, this->vsync_pulse_width_, this->vsync_back_porch_, this->vsync_front_porch_, YESNO(this->invert_colors_), - (unsigned) (this->pclk_frequency_ / 1000000), get_pin_name(this->reset_pin_).c_str(), - get_pin_name(this->de_pin_).c_str(), get_pin_name(this->pclk_pin_).c_str(), - get_pin_name(this->hsync_pin_).c_str(), get_pin_name(this->vsync_pin_).c_str()); + (unsigned) (this->pclk_frequency_ / 1000000), get_pin_name(this->reset_pin_, reset_buf), + get_pin_name(this->de_pin_, de_buf), get_pin_name(this->pclk_pin_, pclk_buf), + get_pin_name(this->hsync_pin_, hsync_buf), get_pin_name(this->vsync_pin_, vsync_buf)); this->dump_pins_(8, 13, "Blue", 0); this->dump_pins_(13, 16, "Green", 0);