Skip to content

Commit

Permalink
drivers: serial: native tty: Split in top and bottom
Browse files Browse the repository at this point in the history
Split the native tty serial driver in a top and bottom to enable using it
with embedded libCs.

Signed-off-by: Marko Sagadin <marko.sagadin42@gmail.com>
  • Loading branch information
MarkoSagadin committed Aug 4, 2023
1 parent 0aaedf7 commit 7ffcc6d
Show file tree
Hide file tree
Showing 5 changed files with 389 additions and 229 deletions.
2 changes: 1 addition & 1 deletion boards/posix/native_sim/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ host libC (:kconfig:option:`CONFIG_EXTERNAL_LIBC`).
log backend, native backend, :kconfig:option:`CONFIG_LOG_BACKEND_NATIVE_POSIX`, all
rtc, RTC emul, :kconfig:option:`CONFIG_RTC_EMUL`, all
serial, uart native posix/PTTY, :kconfig:option:`CONFIG_UART_NATIVE_POSIX`, all
serial, uart native TTY, :kconfig:option:`CONFIG_UART_NATIVE_TTY`, host libC
serial, uart native TTY, :kconfig:option:`CONFIG_UART_NATIVE_TTY`, all
spi, SPI emul, :kconfig:option:`CONFIG_SPI_EMUL`, all
system tick, native_posix timer, :kconfig:option:`CONFIG_NATIVE_POSIX_TIMER`, all
tracing, Posix tracing backend, :kconfig:option:`CONFIG_TRACING_BACKEND_POSIX`, all
Expand Down
5 changes: 5 additions & 0 deletions drivers/serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ endif()
if(CONFIG_UART_NATIVE_TTY)
zephyr_library_compile_definitions(NO_POSIX_CHEATS)
zephyr_library_sources(uart_native_tty.c)
if (CONFIG_NATIVE_APPLICATION)
zephyr_library_sources(uart_native_tty_bottom.c)
else()
target_sources(native_simulator INTERFACE uart_native_tty_bottom.c)
endif()
endif()

zephyr_library_sources_ifdef(CONFIG_SERIAL_TEST serial_test.c)
Loading

0 comments on commit 7ffcc6d

Please sign in to comment.