Skip to content

Commit

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

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
  • Loading branch information
aescolar committed Jul 6, 2023
1 parent 6e53732 commit 67f7069
Show file tree
Hide file tree
Showing 7 changed files with 571 additions and 473 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 @@ -120,7 +120,7 @@ host libC (:kconfig:option:`CONFIG_EXTERNAL_LIBC`).
input, input SDL touch, :kconfig:option:`CONFIG_INPUT_SDL_TOUCH`, host 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`, host libC
serial, uart native posix/PTTY, :kconfig:option:`CONFIG_UART_NATIVE_POSIX`, all
serial, uart native TTY, :kconfig:option:`CONFIG_UART_NATIVE_TTY`, host libC
spi, SPI emul, :kconfig:option:`CONFIG_SPI_EMUL`, all
system tick, native_posix timer, :kconfig:option:`CONFIG_NATIVE_POSIX_TIMER`, all
Expand Down
7 changes: 6 additions & 1 deletion drivers/serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ zephyr_library_sources_ifdef(CONFIG_USERSPACE uart_handlers.c)

if(CONFIG_UART_NATIVE_POSIX)
zephyr_library_compile_definitions(NO_POSIX_CHEATS)
zephyr_library_sources(uart_native_posix.c)
zephyr_library_sources(uart_native_ptty.c)
if (CONFIG_NATIVE_APPLICATION)
zephyr_library_sources(uart_native_ptty_bottom.c)
else()
target_sources(native_simulator INTERFACE uart_native_ptty_bottom.c)
endif()
endif()

if(CONFIG_UART_NATIVE_TTY)
Expand Down
1 change: 0 additions & 1 deletion drivers/serial/Kconfig.native_posix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ config UART_NATIVE_POSIX
bool "UART driver for native_posix"
default y
depends on DT_HAS_ZEPHYR_NATIVE_POSIX_UART_ENABLED
depends on EXTERNAL_LIBC
select SERIAL_HAS_DRIVER
help
This enables a UART driver for the POSIX ARCH with up to 2 UARTs.
Expand Down
Loading

0 comments on commit 67f7069

Please sign in to comment.