-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
shell: add generic RX buffer flush function #79371
shell: add generic RX buffer flush function #79371
Conversation
ab9d738
to
8a9c440
Compare
8a9c440
to
882fe44
Compare
e0b64f2
to
fad60f3
Compare
@nordic-krch kind reminder |
fad60f3
to
982a06e
Compare
982a06e
to
2ade93e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't there a shell backend with a custom flush function?
Commit now has flushing function but it is not called anywhere and commit message states that it is called during resume. |
2ade93e
to
e27563c
Compare
I don’t recall any backend flush function; there was only a function to flush the shell's TX buffer. |
Added a generic function `z_shell_backend_rx_buffer_flush` to clear the RX buffer when resuming the shell. The function repeatedly calls the backend's `read` API until the buffer is empty or a maximum of 1000 iterations is reached. This prevents unintended command execution after `shell_start`. Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
e27563c
to
993b8bb
Compare
Added a generic function
z_shell_backend_rx_buffer_flush
to clear the RX buffer when resuming the shell. The function repeatedly calls the backend'sread
API until the buffer is empty or a maximum of 1000 iterations is reached. This prevents unintended command execution aftershell_start
.