Skip to content

Conversation

@siteswapjuggler
Copy link

Fix compatibility with ESP-IDF >= 5.3

ESP-IDF 5.3 removed the module field from uart_signal_conn_t. This patch replaces it with a version-safe reference to PERIPH_UARTx_MODULE which seems to have been normalised in the new ESP-IDF iteration.

Conditionnal MACRO are use to keep compatibility with both ESP-IDF 5.1 and 5.3.

Tested with:

  • ESP-IDF 5.1.4 (ESP32-C3)
  • ESP-IDF 5.3.0 (ESP32-C3)

struct dmx_uart_t *uart = &dmx_uart_context[dmx_num];
if (uart->num != 0) { // Default UART port for console
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
periph_module_disable(PERIPH_UART1_MODULE+dmx_num);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is different from the rest. Shouldn't is just use PERIPH_UART0_MODULE+uart->num to be consistent with the variant below?

@riwalker
Copy link

riwalker commented Jul 25, 2025 via email

@septatrix
Copy link

I don’t know which code you are comparing to, did you see the latest I relezsed to support 5.3 and 5.4 ?

The first change (replacing enum member with define) is already included in the latest release but the other change (replacing the .module strut access) is still needed for me to successfully compile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants