Skip to content

Commit b8008c4

Browse files
ycsincarlescufi
authored andcommitted
shell: shell_uart: improve macro compatibility with previous version
The `SHELL_UART_DEFINE` macro was previously `SHELL_UART_DEFINE(_name, _tx_ringbuf_size, _rx_ringbuf_size)`, before it got removed in zephyrproject-rtos#63967 and then reinstated in zephyrproject-rtos#66218 as `SHELL_UART_DEFINE(_name)`. However its current form isn't compatible with previous Zephyr version, and would cause compilation error when an application migrates from to v3.6, let's modify it to accept variable arguments for now. Added documentation for this public API and updated the migration guide accordingly. Signed-off-by: Yong Cong Sin <[email protected]>
1 parent b09cd03 commit b8008c4

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

doc/releases/migration-guide-3.6.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ Shell
242242
* :kconfig:option:`CONFIG_W1_SHELL`
243243
* :kconfig:option:`CONFIG_WDT_SHELL`
244244

245+
* The ``SHELL_UART_DEFINE`` macro now only requires a ``_name`` argument. In the meantime, the
246+
macro accepts additional arguments (ring buffer TX & RX size arguments) for compatibility with
247+
previous Zephyr version, but they are ignored, and will be removed in future release.
248+
245249
Bootloader
246250
==========
247251

include/zephyr/shell/shell_uart.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ struct shell_uart_polling {
8181
#define SHELL_UART_STRUCT struct shell_uart_int_driven
8282
#endif
8383

84-
#define SHELL_UART_DEFINE(_name) \
84+
/**
85+
* @brief Macro for creating shell UART transport instance named @p _name
86+
*
87+
* @note Additional arguments are accepted (but ignored) for compatibility with
88+
* previous Zephyr version, it will be removed in future release.
89+
*/
90+
#define SHELL_UART_DEFINE(_name, ...) \
8591
static SHELL_UART_STRUCT _name##_shell_uart; \
8692
struct shell_transport _name = { \
8793
.api = &shell_uart_transport_api, \

0 commit comments

Comments
 (0)