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

shell: Fix shell init procedure when configured as inactive on startup #67400

Conversation

jakub-uC
Copy link
Contributor

@jakub-uC jakub-uC commented Jan 9, 2024

The previous behavior of the CONFIG_SHELL_AUTOSTART option, where setting it to 'n' disabled shell interaction at startup but kept the logger active as a shell backend, was inconsistent.
Now, when CONFIG_SHELL_AUTOSTART is set to 'n', both the shell and the logger are inactive at startup. Calling the shell_star function will activate them and print any pending logs. This change ensures a more consistent and logical behavior regarding shell and logger activity at startup.

Additionally, now when the shell_stop function is called, both the shell and the logger are halted.

@zephyrbot zephyrbot added the area: Shell Shell subsystem label Jan 9, 2024
@zephyrbot zephyrbot requested a review from carlescufi January 9, 2024 17:37
@jakub-uC jakub-uC force-pushed the shell-fix-locked-start-feature branch 2 times, most recently from 76f2714 to 08a27a0 Compare January 9, 2024 17:46
@jakub-uC jakub-uC added bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug labels Jan 9, 2024
subsys/shell/shell.c Outdated Show resolved Hide resolved
The previous behavior of the CONFIG_SHELL_AUTOSTART option, where setting
it to 'n' disabled shell interaction at startup but kept the logger
active as a shell backend, was inconsistent.
Now, when CONFIG_SHELL_AUTOSTART is set to 'n', both the shell and the
logger are inactive at startup. Calling the shell_start function will
activate them and print any pending logs. This change ensures a more
consistent and logical behavior regarding shell and logger activity at
startup.

Additionally, now when the shell_stop function is called, both the shell
and the logger are halted. This enhancement ensures that stopping
the shell also effectively stops the associated logger.

Signed-off-by: Jakub Rzeszutko <[email protected]>
@jakub-uC jakub-uC force-pushed the shell-fix-locked-start-feature branch from 08a27a0 to 68097cc Compare January 10, 2024 14:41
@jakub-uC
Copy link
Contributor Author

@nordic-krch @henrikbrixandersen please let me know if there is anything else to do?

@jakub-uC
Copy link
Contributor Author

@carlescufi I think we can merge this one.

@henrikbrixandersen henrikbrixandersen merged commit 04de43b into zephyrproject-rtos:main Jan 21, 2024
18 checks passed
@@ -798,6 +799,9 @@ struct shell_ctx {
/** When bypass is set, all incoming data is passed to the callback. */
shell_bypass_cb_t bypass;

/*!< Logging level for a backend. */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be:

Suggested change
/*!< Logging level for a backend. */
/** Logging level for a backend. */

Any chance you could follow up with a commit to fix this? given this is API, it's always nicer if documentation is accurate there. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Shell Shell subsystem bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants