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_rxUsing stdio_clear_rxMinimal 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
\nfor example) after a call ofscanffor the next call ofscanf.Testing procedure
Have an application with multiple calls of
scanfand usestdio_flush_rxat some places and don't use it on others.