-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sys/stdio_uart: add stdio_clear_stdin #19837
Conversation
bikeshedding: you'd "flush" output, "drain" input? |
I think I'd rather go with a simple "clear" then instead, maybe "stdio_clear_input"? |
Should we get this in for the release? |
Needs a rebase, you can move this to |
What about
STDIO_LEGACY_MODULES = \
ethos_stdio \
stdio_ethos \
stdio_native # requires #19002 \
#
# select stdio_uart if no other stdio module is slected
ifeq (,$(filter $(STDIO_MODULES),$(USEMODULE)))
USEMODULE += stdio_uart
endif
ifeq (,$(filter $(STDIO_LEGACY_MODULES),$(USEMODULE)))
USEMODULE += stdio
endif
|
True, |
8d4c2e9
to
acebfae
Compare
@HendrikVE: Ping? |
acebfae
to
85984e7
Compare
It's called Not using stdio_clear_rx
Using stdio_clear_rx
Minimal program that I used:
|
A tiny edit makes sure that
|
059bb79
to
aa13546
Compare
The PR and commit title needs an update now |
aa13546
to
6f9edfe
Compare
Did so and also renamed to |
Contribution description
This PR introduces a new pseudomodule. It is currently only implemented for
stdio_uart
.The use case is to clear the input buffer so we can throw away the remaining input (like
\n
for example) after a call ofscanf
for the next call ofscanf
.Testing procedure
Have an application with multiple calls of
scanf
and usestdio_flush_rx
at some places and don't use it on others.