diff --git a/Makefile.dep b/Makefile.dep index b584e6553b52..12fdaa68cbf1 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -398,6 +398,10 @@ ifneq (,$(filter stdio_rtt,$(USEMODULE))) endif ifneq (,$(filter shell,$(USEMODULE))) + USEMODULE += stdin +endif + +ifneq (,$(filter stdin,$(USEMODULE))) ifneq (,$(filter stdio_uart,$(USEMODULE))) USEMODULE += stdio_uart_rx endif diff --git a/dist/tools/nrf52_resetpin_cfg/Makefile b/dist/tools/nrf52_resetpin_cfg/Makefile index 23c5e784169c..66fda0aec038 100644 --- a/dist/tools/nrf52_resetpin_cfg/Makefile +++ b/dist/tools/nrf52_resetpin_cfg/Makefile @@ -5,6 +5,9 @@ APPLICATION = nrf52_resetpin_cfg BOARD ?= nrf52dk RIOTBASE ?= $(CURDIR)/../../.. +# This application uses getchar and thus expects input from stdio +USEMODULE += stdin + # the RESET_PIN environment variable allows for manually specifying the reset # pin that is programmed. Below this Makefile already contains the specific pins # for some known platforms diff --git a/makefiles/pseudomodules.inc.mk b/makefiles/pseudomodules.inc.mk index 1bbc7c0e431d..70d47865a2c5 100644 --- a/makefiles/pseudomodules.inc.mk +++ b/makefiles/pseudomodules.inc.mk @@ -73,6 +73,7 @@ PSEUDOMODULES += sock PSEUDOMODULES += sock_ip PSEUDOMODULES += sock_tcp PSEUDOMODULES += sock_udp +PSEUDOMODULES += stdin PSEUDOMODULES += stdio_uart_rx # print ascii representation in function od_hex_dump() diff --git a/sys/include/stdio_uart.h b/sys/include/stdio_uart.h index bfe975c67e50..5b995d6383f1 100644 --- a/sys/include/stdio_uart.h +++ b/sys/include/stdio_uart.h @@ -13,6 +13,12 @@ * * @brief Standard input/output backend using UART * + * @warning Standard input is disabled by default on UART. To enable it, load + * the `stdin` module in your application: + * ``` + * USEMODULE += stdin + * ``` + * * @{ * @file * diff --git a/tests/lua_loader/Makefile b/tests/lua_loader/Makefile index 3c8c0e93d52c..ef7a3aa5d576 100644 --- a/tests/lua_loader/Makefile +++ b/tests/lua_loader/Makefile @@ -2,6 +2,9 @@ include ../Makefile.tests_common USEPKG += lua +# This application uses getchar and thus expects input from stdio +USEMODULE += stdin + BOARD_WHITELIST += native samr21-xpro ifneq ($(BOARD),native) diff --git a/tests/posix_time/Makefile b/tests/posix_time/Makefile index 555036d53c7f..d1a1ee9bb8d7 100644 --- a/tests/posix_time/Makefile +++ b/tests/posix_time/Makefile @@ -2,6 +2,9 @@ include ../Makefile.tests_common USEMODULE += posix_time +# This application uses getchar and thus expects input from stdio +USEMODULE += stdin + TEST_ON_CI_WHITELIST += all include $(RIOTBASE)/Makefile.include diff --git a/tests/xtimer_usleep/Makefile b/tests/xtimer_usleep/Makefile index a51966755eaf..1af1bdee925c 100644 --- a/tests/xtimer_usleep/Makefile +++ b/tests/xtimer_usleep/Makefile @@ -5,6 +5,9 @@ USEMODULE += xtimer # This test randomly fails on `native` so disable it from CI TEST_ON_CI_WHITELIST += samr21-xpro +# This application uses getchar and thus expects input from stdio +USEMODULE += stdin + # Port and pin configuration for probing with oscilloscope # Port number should be found in port enum e.g in cpu/include/periph_cpu.h #FEATURES_REQUIRED += periph_gpio