Skip to content

Commit 5228de3

Browse files
Jordan Yatescarlescufi
authored andcommitted
modem: choice symbol for UART backend
Add a choice symbol that is used to select which UART backend to use. This allows backends that don't use the interrupt API to be implemented. Signed-off-by: Jordan Yates <[email protected]>
1 parent a6081ee commit 5228de3

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

drivers/modem/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ zephyr_library_sources_ifdef(CONFIG_MODEM_CONTEXT
1010
modem_pin.c
1111
)
1212

13-
zephyr_library_sources_ifdef(CONFIG_MODEM_IFACE_UART modem_iface_uart.c)
13+
zephyr_library_sources_ifdef(CONFIG_MODEM_IFACE_UART_INTERRUPT modem_iface_uart_interrupt.c)
1414
zephyr_library_sources_ifdef(CONFIG_MODEM_CMD_HANDLER modem_cmd_handler.c)
1515
zephyr_library_sources_ifdef(CONFIG_MODEM_SOCKET modem_socket.c)
1616

drivers/modem/Kconfig

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,28 @@ config MODEM_CONTEXT_VERBOSE_DEBUG
6464

6565
config MODEM_IFACE_UART
6666
bool "UART-based modem interface"
67-
depends on SERIAL_SUPPORT_INTERRUPT
68-
select UART_INTERRUPT_DRIVEN
6967
select RING_BUFFER
7068
help
7169
To configure this layer for use, create a modem_iface_uart_data
7270
object and pass it's reference to modem_iface_uart_init()
7371
along with the modem_iface reference from your modem_context object
7472
and the UART device name.
7573

74+
if MODEM_IFACE_UART
75+
76+
choice MODEM_IFACE_UART_BACKEND
77+
prompt "UART backend to use for modem interface"
78+
default MODEM_IFACE_UART_INTERRUPT
79+
80+
config MODEM_IFACE_UART_INTERRUPT
81+
bool "UART-based modem interface using interrupt API"
82+
depends on SERIAL_SUPPORT_INTERRUPT
83+
select UART_INTERRUPT_DRIVEN
84+
85+
endchoice
86+
87+
endif # MODEM_IFACE_UART
88+
7689
config MODEM_CMD_HANDLER
7790
bool "Generic modem command handler"
7891
select NET_BUF
File renamed without changes.

0 commit comments

Comments
 (0)