Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/dmx/hal/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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) {
Expand Down