Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdio_dispatch: allow to select multiple stdio methods at the same time #19738

Merged
merged 19 commits into from
Feb 9, 2024

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Jun 16, 2023

Contribution description

This implements the option to have multiple stdio methods active at the same time.
This can be useful to allow e.g. remote debugging while also retaining the possibility for local shell access.

To implement this, all stdin implementations are expected to write to a common stdin_isrpipe.

Two stdio providers have not been converted to the new interface yet, that means they can't be combined with a second stdio method:

If only a single stdio method is used, the function pointer/XFA based interface degrades into the traditional in-place implementations of stdio_init()/stdio_write() to avoid introducing any overhead in the common case.

Testing procedure

It is now possible to select multiple stdio implementations and use them all at the same time:

USEMODULE += stdio_cdc_acm
USEMODULE += stdio_uart
USEMODULE += stdio_udp
USEMODULE += stdio_telnet
USEMODULE += stdio_rtt

Issues/PRs references

fixes #13469

@github-actions github-actions bot added Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: network Area: Networking Area: pkg Area: External package ports Area: sys Area: System Area: USB Area: Universal Serial Bus Platform: ESP Platform: This PR/issue effects ESP-based platforms labels Jun 16, 2023
@benpicco benpicco changed the title Stdio dispatch stdio_dispatch: allow to select multiple stdio methods at the same time Jun 16, 2023
@benpicco benpicco requested a review from maribu June 16, 2023 14:01
@benpicco benpicco requested a review from kaspar030 as a code owner June 16, 2023 14:05
@benpicco benpicco force-pushed the stdio_dispatch branch 2 times, most recently from 6e03795 to fe4b248 Compare June 16, 2023 14:22
sys/include/stdio_base.h Outdated Show resolved Hide resolved
@github-actions github-actions bot added the Area: drivers Area: Device drivers label Feb 2, 2024
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 2, 2024
@benpicco
Copy link
Contributor Author

benpicco commented Feb 2, 2024

This is now ready for review again.

@riot-ci
Copy link

riot-ci commented Feb 2, 2024

Murdock results

✔️ PASSED

018b732 pkg/tinyusb/cdc_acm_stdio: only enable RX callback if stdin is active

Success Failures Total Runtime
10016 0 10016 10m:18s

Artifacts

@benpicco benpicco added this pull request to the merge queue Feb 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 9, 2024
@benpicco benpicco added this pull request to the merge queue Feb 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 9, 2024
@benpicco benpicco added this pull request to the merge queue Feb 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 9, 2024
@benpicco benpicco added this pull request to the merge queue Feb 9, 2024
Merged via the queue into RIOT-OS:master with commit 55b6728 Feb 9, 2024
25 checks passed
@benpicco benpicco deleted the stdio_dispatch branch February 9, 2024 18:06
@MrKevinWeiss MrKevinWeiss added this to the Release 2024.04 milestone Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: drivers Area: Device drivers Area: network Area: Networking Area: pkg Area: External package ports Area: sys Area: System Area: USB Area: Universal Serial Bus CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stdio: a layered / multiheaded approach to I/O
6 participants