From dcff159a335ea1bc7457ca5b7151e98eddf61e2c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 19 Feb 2026 17:20:54 -0600 Subject: [PATCH] [uart] Make is_default_uart0_pin constexpr Co-Authored-By: Claude Opus 4.6 --- esphome/components/uart/uart_component_esp_idf.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/components/uart/uart_component_esp_idf.cpp b/esphome/components/uart/uart_component_esp_idf.cpp index 0545d8a180..ea7a09fee6 100644 --- a/esphome/components/uart/uart_component_esp_idf.cpp +++ b/esphome/components/uart/uart_component_esp_idf.cpp @@ -22,7 +22,9 @@ static const char *const TAG = "uart.idf"; /// Check if a pin number matches one of the default UART0 GPIO pins. /// These pins may have residual state from the boot console that requires /// explicit reset before UART reconfiguration (ESP-IDF issue #17459). -static bool is_default_uart0_pin(int8_t pin_num) { return pin_num == U0TXD_GPIO_NUM || pin_num == U0RXD_GPIO_NUM; } +static constexpr bool is_default_uart0_pin(int8_t pin_num) { + return pin_num == U0TXD_GPIO_NUM || pin_num == U0RXD_GPIO_NUM; +} uart_config_t IDFUARTComponent::get_config_() { uart_parity_t parity = UART_PARITY_DISABLE;