Skip to content

Commit 6847421

Browse files
ycsinjhedberg
authored andcommitted
shell: backends: select RING_BUFFER_LARGE when necessary
Depending on the ring buffer configuration, users may encounter the "size too big" assertion in runtime. Let's enable the RING_BUFFER_LARGE when we know that it is required. Signed-off-by: Yong Cong Sin <ycsin@meta.com> Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
1 parent aff6123 commit 6847421

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

subsys/shell/backends/Kconfig.backends

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ config SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE
9898
escape sequences). However, if bulk data is transferred it may be
9999
required to increase it.
100100

101+
config SHELL_BACKEND_SERIAL_NEEDS_LARGE_RING_BUFFER
102+
bool
103+
default y if SHELL_BACKEND_SERIAL_TX_RING_BUFFER_SIZE > $(INT16_MAX)
104+
default y if SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE > $(INT16_MAX)
105+
select RING_BUFFER_LARGE
106+
help
107+
This is a helper Kconfig to select RING_BUFFER_LARGE when the implementation
108+
requires a ring buffer of > 32kB.
109+
101110
if SHELL_BACKEND_SERIAL_API_ASYNC
102111

103112
config SHELL_BACKEND_SERIAL_ASYNC_RX_TIMEOUT
@@ -322,6 +331,14 @@ config SHELL_MQTT_RX_BUF_SIZE
322331
help
323332
Buffer size for the MQTT data reception.
324333

334+
config SHELL_MQTT_NEEDS_LARGE_RING_BUFFER
335+
bool
336+
default y if SHELL_MQTT_RX_BUF_SIZE > $(INT16_MAX)
337+
select RING_BUFFER_LARGE
338+
help
339+
This is a helper Kconfig to select RING_BUFFER_LARGE when the implementation
340+
requires a ring buffer of > 32kB.
341+
325342
config SHELL_MQTT_TX_BUF_SIZE
326343
int "TX buffer size"
327344
range 32 $(UINT16_MAX)

0 commit comments

Comments
 (0)