From ed12a2909960c92d7f144d368564e2473bd38c63 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 8 Nov 2025 09:39:04 +0000 Subject: [PATCH] Add proper checks to exclude code for older ESP-IDF versions --- src/dmx/hal/uart.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dmx/hal/uart.c b/src/dmx/hal/uart.c index aabd1cd94..26a861de0 100644 --- a/src/dmx/hal/uart.c +++ b/src/dmx/hal/uart.c @@ -327,6 +327,7 @@ static void DMX_ISR_ATTR dmx_uart_isr(void *arg) { bool dmx_uart_init(dmx_port_t dmx_num, void *isr_context, int isr_flags) { struct dmx_uart_t *uart = &dmx_uart_context[dmx_num]; +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 2, 0) periph_module_enable(uart_periph_signal[dmx_num].module); if (dmx_num != 0) { // Default UART port for console #if SOC_UART_REQUIRE_CORE_RESET @@ -338,6 +339,7 @@ bool dmx_uart_init(dmx_port_t dmx_num, void *isr_context, int isr_flags) { periph_module_reset(uart_periph_signal[dmx_num].module); #endif } +#endif #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) uint32_t sclk_freq; #if CONFIG_IDF_TARGET_ESP32C6 @@ -380,9 +382,11 @@ bool dmx_uart_init(dmx_port_t dmx_num, void *isr_context, int isr_flags) { void dmx_uart_deinit(dmx_port_t dmx_num) { struct dmx_uart_t *uart = &dmx_uart_context[dmx_num]; +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 2, 0) if (uart->num != 0) { // Default UART port for console periph_module_disable(uart_periph_signal[uart->num].module); } +#endif } bool dmx_uart_set_pin(dmx_port_t dmx_num, int tx, int rx, int rts) {