shell: enable UART backend without interrupts

Currently shell UART backend is interrupt driven if UART driver
is interrupt driven. That can be limitation if one instance
wants to use interrupts but shell UART should not.

Added option to shell uart to be able to control use of
interrupts. By default interrupts are enabled if driver
supports it.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2018-11-21 09:16:56 +01:00 committed by Anas Nashif
commit af973ca1e9
3 changed files with 16 additions and 17 deletions

View file

@ -26,7 +26,7 @@ struct shell_uart_ctrl_blk {
bool blocking;
};
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
#ifdef CONFIG_SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN
#define UART_SHELL_TX_RINGBUF_DECLARE(_name, _size) \
RING_BUF_DECLARE(_name##_tx_ringbuf, _size)
@ -39,13 +39,13 @@ struct shell_uart_ctrl_blk {
#define UART_SHELL_RX_TIMER_PTR(_name) NULL
#else /* CONFIG_UART_INTERRUPT_DRIVEN */
#else /* CONFIG_SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN */
#define UART_SHELL_TX_RINGBUF_DECLARE(_name, _size) /* Empty */
#define UART_SHELL_TX_BUF_DECLARE(_name) /* Empty */
#define UART_SHELL_RX_TIMER_DECLARE(_name) static struct k_timer _name##_timer
#define UART_SHELL_TX_RINGBUF_PTR(_name) NULL
#define UART_SHELL_RX_TIMER_PTR(_name) (&_name##_timer)
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
#endif /* CONFIG_SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN */
/** @brief Shell UART transport instance structure. */
struct shell_uart {