1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-23 13:33:49 +01:00

Merge pull request #21294 from benpicco/stdio_default

boards: introduce `stdio_default`
This commit is contained in:
mguetschow 2025-03-21 11:46:27 +00:00 committed by GitHub
commit f3dbed405e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 50 additions and 65 deletions

View File

@ -2,6 +2,11 @@
-include $(APPDIR)/Makefile.board.dep
-include $(APPDIR)/Makefile.$(TOOLCHAIN).dep
# select default stdio provider if no other is selected
ifeq (,$(filter stdio_% slipdev_stdio,$(USEMODULE)))
USEMODULE += stdio_default
endif
# include board dependencies
-include $(BOARDDIR)/Makefile.dep

View File

@ -0,0 +1,19 @@
ifneq (,$(filter stdio_default,$(USEMODULE)))
ifneq (,$(filter usbus,$(USEMODULE)))
USEMODULE += stdio_cdc_acm
FEATURES_REQUIRED += highlevel_stdio
else ifneq (,$(filter tinyusb_device,$(USEMODULE)))
USEMODULE += stdio_tinyusb_cdc_acm
FEATURES_REQUIRED += highlevel_stdio
else
# Use stdio_usb_serial_jtag if no other stdio is requested explicitly
# and neither USBUS nor tinyusb_device are used
USEMODULE += stdio_usb_serial_jtag
endif
# Even if only stdio_usb_serial_jtag is enabled, usb_board_reset is enabled
# since there should be a CDC ACM interface in any case. This is necessary,
# for example, to reset the board if stdio_cdc_acm or stdio_tinyusb_cdc_acm
# was previously used.
USEMODULE += usb_board_reset
include $(RIOTMAKE)/tools/usb_board_reset.mk
endif

View File

@ -1,4 +1,4 @@
ifeq (,$(filter-out stdio_cdc_acm,$(filter stdio_% slipdev_stdio,$(USEMODULE))))
ifneq (,$(filter stdio_default,$(USEMODULE)))
ifneq (,$(filter tinyusb_device,$(USEMODULE))$(filter tinyusb,$(USEPKG)))
# Use stdio_tinyusb_cdc_acm only if no other stdio is requested explicitly
# and tinyusb_device is used for any other reason

View File

@ -1,4 +1,4 @@
ifeq (,$(filter stdio_% slipdev_stdio,$(USEMODULE)))
ifneq (,$(filter stdio_default,$(USEMODULE)))
# Use stdio_tinyusb_cdc_acm only if no other stdio is requested explicitly.
# and usbus is used for any other reason
ifneq (,$(filter usbus,$(USEMODULE)))

View File

@ -1,4 +1,4 @@
ifeq (,$(filter stdio_% slipdev_stdio,$(USEMODULE)))
ifneq (,$(filter stdio_default,$(USEMODULE)))
USEMODULE += stdio_usb_serial_jtag
endif

View File

@ -1,15 +1,3 @@
ifeq (,$(filter stdio_% slipdev_stdio usbus usbus% tinyusb_device,$(USEMODULE)))
# Use stdio_usb_serial_jtag if no other stdio is requested explicitly
# and neither USBUS nor tinyusb_device are used
USEMODULE += stdio_usb_serial_jtag
# Even if only stdio_usb_serial_jtag is enabled, usb_board_reset is enabled
# since there should be a CDC ACM interface in any case. This is necessary,
# for example, to reset the board if stdio_cdc_acm or stdio_tinyusb_cdc_acm
# was previously used.
USEMODULE += usb_board_reset
# include $(RIOTMAKE)/tools/usb_board_reset.mk
endif
ifneq (,$(filter disp_dev,$(USEMODULE)))
USEMODULE += ili9341
endif
@ -18,5 +6,5 @@ ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/esp32s3/stdio_esp32s3_default.dep.mk
include $(RIOTBOARD)/common/esp32s3/Makefile.dep
include $(RIOTBOARD)/common/makefiles/stdio_cdc_acm.dep.mk

View File

@ -1,18 +1,6 @@
ifeq (,$(filter stdio_% slipdev_stdio usbus usbus% tinyusb_device,$(USEMODULE)))
# Use stdio_usb_serial_jtag if no other stdio is requested explicitly
# and neither USBUS nor tinyusb_device are used
USEMODULE += stdio_usb_serial_jtag
# Even if only stdio_usb_serial_jtag is enabled, usb_board_reset is enabled
# since there should be a CDC ACM interface in any case. This is necessary,
# for example, to reset the board if stdio_cdc_acm or stdio_tinyusb_cdc_acm
# was previously used.
USEMODULE += usb_board_reset
include $(RIOTMAKE)/tools/usb_board_reset.mk
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/esp32s3/stdio_esp32s3_default.dep.mk
include $(RIOTBOARD)/common/esp32s3/Makefile.dep
include $(RIOTBOARD)/common/makefiles/stdio_cdc_acm.dep.mk

View File

@ -1,17 +1,5 @@
ifeq (,$(filter stdio_% slipdev_stdio usbus usbus% tinyusb_device,$(USEMODULE)))
# Use stdio_usb_serial_jtag if no other stdio is requested explicitly
# and neither USBUS nor tinyusb_device are used
USEMODULE += stdio_usb_serial_jtag
# Even if only stdio_usb_serial_jtag is enabled, usb_board_reset is enabled
# since there should be a CDC ACM interface in any case. This is necessary,
# for example, to reset the board if stdio_cdc_acm or stdio_tinyusb_cdc_acm
# was previously used.
USEMODULE += usb_board_reset
include $(RIOTMAKE)/tools/usb_board_reset.mk
endif
include $(RIOTBOARD)/common/esp32s3/stdio_esp32s3_default.dep.mk
include $(RIOTBOARD)/common/esp32s3/Makefile.dep
include $(RIOTBOARD)/common/makefiles/stdio_cdc_acm.dep.mk
# default to using fatfs on SD card
ifneq (,$(filter vfs_default,$(USEMODULE)))

View File

@ -1,17 +1,5 @@
ifeq (,$(filter stdio_% slipdev_stdio usbus usbus% tinyusb_device,$(USEMODULE)))
# Use stdio_usb_serial_jtag if no other stdio is requested explicitly
# and neither USBUS nor tinyusb_device are used
USEMODULE += stdio_usb_serial_jtag
# Even if only stdio_usb_serial_jtag is enabled, usb_board_reset is enabled
# since there should be a CDC ACM interface in any case. This is necessary,
# for example, to reset the board if stdio_cdc_acm or stdio_tinyusb_cdc_acm
# was previously used.
USEMODULE += usb_board_reset
# include $(RIOTMAKE)/tools/usb_board_reset.mk
endif
include $(RIOTBOARD)/common/esp32s3/stdio_esp32s3_default.dep.mk
include $(RIOTBOARD)/common/esp32s3/Makefile.dep
include $(RIOTBOARD)/common/makefiles/stdio_cdc_acm.dep.mk
# default to using fatfs on SD card
ifneq (,$(filter vfs_default,$(USEMODULE)))

View File

@ -14,6 +14,6 @@ ifneq (,$(filter saul_default,$(USEMODULE)))
endif
# Use Segger's RTT unless another stdio_% is already used
ifeq (,$(filter stdio_% slipdev_stdio,$(USEMODULE)))
ifneq (,$(filter stdio_default,$(USEMODULE)))
USEMODULE += stdio_rtt
endif

View File

@ -1,4 +1,4 @@
ifeq (,$(filter stdio_% slipdev_stdio,$(USEMODULE)))
ifneq (,$(filter stdio_default,$(USEMODULE)))
USEMODULE += stdio_usb_serial_jtag
endif

View File

@ -1,5 +1,5 @@
# Use Segger's RTT unless another stdio_% is already used
ifeq (,$(filter stdio_% slipdev_stdio,$(USEMODULE)))
ifneq (,$(filter stdio_default,$(USEMODULE)))
USEMODULE += stdio_rtt
endif

View File

@ -5,7 +5,7 @@ ifneq (,$(filter saul_default,$(USEMODULE)))
endif
# Use Segger's RTT unless another stdio_% is already used
ifeq (,$(filter stdio_% slipdev_stdio,$(USEMODULE)))
ifneq (,$(filter stdio_default,$(USEMODULE)))
USEMODULE += stdio_rtt
endif

View File

@ -5,7 +5,7 @@ ifneq (,$(filter saul_default,$(USEMODULE)))
endif
# Use Segger's RTT unless another stdio_% is already used
ifeq (,$(filter stdio_% slipdev_stdio,$(USEMODULE)))
ifneq (,$(filter stdio_default,$(USEMODULE)))
USEMODULE += stdio_rtt
endif

View File

@ -4,7 +4,7 @@ include $(RIOTCPU)/$(CPU)/Makefile.include
DIRS = $(RIOTCPU)/arm7_common
ifneq (,$(filter stdio_%,$(USEMODULE)))
ifneq (,$(filter stdio_fb,$(USEMODULE)))
DIRS += stdio_fb
endif

View File

@ -1,6 +1,6 @@
USEMODULE += arm7_common
ifeq (,$(filter stdio_%,$(USEMODULE)))
ifneq (,$(filter stdio_default,$(USEMODULE)))
USEMODULE += stdio_fb
endif

View File

@ -13,7 +13,7 @@ else
endif
endif
ifeq (,$(filter stdio_%,$(USEMODULE)))
ifneq (,$(filter stdio_default,$(USEMODULE)))
USEMODULE += stdio_native
endif

View File

@ -34,6 +34,9 @@ USEMODULE += ps
# Include the telnet server
USEMODULE += stdio_telnet
# select a 2nd stdio method
USEMODULE += stdio_default
# Enable faster re-connects
CFLAGS += -DCONFIG_GNRC_TCP_EXPERIMENTAL_DYN_MSL_EN=1

View File

@ -79,7 +79,6 @@ int main(void)
/* start shell */
printf("All up, awaiting connection on port %u\n", CONFIG_TELNET_PORT);
puts("Local shell disabled");
char line_buf[SHELL_DEFAULT_BUFSIZE];
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);

View File

@ -488,6 +488,13 @@ PSEUDOMODULES += soft_uart_modecfg
PSEUDOMODULES += stdin
PSEUDOMODULES += stdio_available
PSEUDOMODULES += stdio_cdc_acm
## @defgroup sys_stdio_default Default STDIO provider
## @ingroup sys_stdio
## @{
## This module selects the default STDIO method of a given board.
## It will be enabled by default if no other stdio method is selected.
PSEUDOMODULES += stdio_default
## @}
PSEUDOMODULES += stdio_dispatch
PSEUDOMODULES += stdio_ethos
PSEUDOMODULES += stdio_nimble_debug

View File

@ -33,7 +33,7 @@ ifneq (,$(filter stdin,$(USEMODULE)))
USEMODULE += isrpipe
endif
ifneq (1, $(words $(filter $(STDIO_MODULES),$(USEMODULE))))
ifneq (1, $(words $(sort $(filter $(STDIO_MODULES),$(USEMODULE)))))
USEMODULE += stdio_dispatch
endif