Skip to content

Commit 1fc9756

Browse files
OmerGozderesinashif
authored andcommitted
config: esp32: configurable UART FIFO thresholds
The existing configuration of the ESP32 UART FIFO thresholds was fixed, leading to inefficiencies in handling Modbus RTU packages exceeding this size. This commit introduces two new Kconfig options, allowing users to adjust the esp32 fifo thresholds as needed. fixes #74311 Signed-off-by: Omer Gozderesi <[email protected]> config: esp32: configurable UART FIFO thresholds The existing configuration of the ESP32 UART FIFO thresholds was fixed, leading to inefficiencies in handling Modbus RTU packages exceeding this size. This commit introduces two new Kconfig options, allowing users to adjust the esp32 fifo thresholds as needed. fixes #74311 Signed-off-by: Omer Gozderesi <[email protected]>
1 parent a5668c7 commit 1fc9756

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

drivers/serial/Kconfig.esp32

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,19 @@ config SERIAL_ESP32_USB
2727
USB host. The USB stack is built into the chip and accessed
2828
by the firmware through a simplified API similar to a "normal"
2929
UART peripheral.
30+
31+
config UART_ESP32_TX_FIFO_THRESH
32+
hex "ESP32 UART TX FIFO Threshold"
33+
depends on UART_ESP32
34+
default 0x1
35+
range 1 127
36+
help
37+
Configure the TX FIFO threshold for ESP32 UART driver.
38+
39+
config UART_ESP32_RX_FIFO_THRESH
40+
hex "ESP32 UART RX FIFO Threshold"
41+
depends on UART_ESP32
42+
default 0x16
43+
range 1 127
44+
help
45+
Configure the RX FIFO threshold for ESP32 UART driver.

drivers/serial/uart_esp32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ struct uart_esp32_data {
116116
};
117117

118118
#define UART_FIFO_LIMIT (UART_LL_FIFO_DEF_LEN)
119-
#define UART_TX_FIFO_THRESH 0x1
120-
#define UART_RX_FIFO_THRESH 0x16
119+
#define UART_TX_FIFO_THRESH (CONFIG_UART_ESP32_TX_FIFO_THRESH)
120+
#define UART_RX_FIFO_THRESH (CONFIG_UART_ESP32_RX_FIFO_THRESH)
121121

122122
#if CONFIG_UART_INTERRUPT_DRIVEN || CONFIG_UART_ASYNC_API
123123
static void uart_esp32_isr(void *arg);

0 commit comments

Comments
 (0)