Skip to content

Commit

Permalink
Enable missing Interrupts for half duplex mode
Browse files Browse the repository at this point in the history
The mode UART_MODE_RS485_HALF_DUPLEX is capable of collision detection (given the required circuit), but the interrupts were not enabled. (See e.g. at function `uart_get_collision_flag()` about required modes for detection.
  • Loading branch information
plasger-ebv authored Sep 1, 2022
1 parent 5c1044d commit 84eec37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/driver/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ esp_err_t uart_set_mode(uart_port_t uart_num, uart_mode_t mode)
}
UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock));
uart_hal_set_mode(&(uart_context[uart_num].hal), mode);
if (mode == UART_MODE_RS485_COLLISION_DETECT) {
if ((mode == UART_MODE_RS485_COLLISION_DETECT) || (mode == UART_MODE_RS485_HALF_DUPLEX)) {
// This mode allows read while transmitting that allows collision detection
p_uart_obj[uart_num]->coll_det_flg = false;
// Enable collision detection interrupts
Expand Down

0 comments on commit 84eec37

Please sign in to comment.