From 61b377140f09368e2640e8406ac406562ef6faf9 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 30 Dec 2025 13:03:48 -1000 Subject: [PATCH] copilot suggestion is overkill and breaks things --- esphome/core/gpio.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/esphome/core/gpio.h b/esphome/core/gpio.h index dc9353d28f..5a28198afd 100644 --- a/esphome/core/gpio.h +++ b/esphome/core/gpio.h @@ -12,13 +12,11 @@ namespace esphome { inline constexpr size_t GPIO_SUMMARY_MAX_LEN = 48; #define LOG_PIN(prefix, pin) \ - do { \ - if ((pin) != nullptr) { \ - char pin_buf_[GPIO_SUMMARY_MAX_LEN]; \ - (pin)->dump_summary(pin_buf_, sizeof(pin_buf_)); \ - ESP_LOGCONFIG(TAG, prefix "%s", pin_buf_); \ - } \ - } while (false) + if ((pin) != nullptr) { \ + char pin_buf_[GPIO_SUMMARY_MAX_LEN]; \ + (pin)->dump_summary(pin_buf_, sizeof(pin_buf_)); \ + ESP_LOGCONFIG(TAG, prefix "%s", pin_buf_); \ + } // put GPIO flags in a namespace to not pollute esphome namespace namespace gpio {