mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge #19268
19268: shell_lock: don't set CONFIG_SHELL_SHUTDOWN_ON_EXIT r=benpicco a=benpicco Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de> Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
This commit is contained in:
commit
d58f2c8501
@ -50,7 +50,7 @@ extern "C" {
|
||||
* Instead terminate RIOT, which is also the behavior a user would
|
||||
* expect from a CLI application.
|
||||
*/
|
||||
# if defined(CPU_NATIVE)
|
||||
# if defined(CPU_NATIVE) && !IS_ACTIVE(MODULE_SHELL_LOCK)
|
||||
# define CONFIG_SHELL_SHUTDOWN_ON_EXIT 1
|
||||
# else
|
||||
# define CONFIG_SHELL_SHUTDOWN_ON_EXIT 0
|
||||
|
@ -68,6 +68,11 @@ void shell_lock_checkpoint(char *line_buf, int buf_size);
|
||||
*/
|
||||
bool shell_lock_is_locked(void);
|
||||
|
||||
/**
|
||||
* @brief Lock the shell
|
||||
*/
|
||||
void shell_lock_do_lock(void);
|
||||
|
||||
#ifdef MODULE_SHELL_LOCK_AUTO_LOCKING
|
||||
/**
|
||||
* @brief Restart the timeout interval before the shell is locked
|
||||
|
@ -501,6 +501,9 @@ void shell_run_once(const shell_command_t *shell_commands,
|
||||
switch (res) {
|
||||
|
||||
case EOF:
|
||||
if (IS_USED(MODULE_SHELL_LOCK)) {
|
||||
shell_lock_do_lock();
|
||||
}
|
||||
return;
|
||||
|
||||
case -ENOBUFS:
|
||||
|
@ -143,10 +143,15 @@ static void _login_barrier(char *line_buf, size_t buf_size)
|
||||
#ifdef MODULE_STDIO_TELNET
|
||||
void telnet_cb_disconneced(void)
|
||||
{
|
||||
_shell_is_locked = true;
|
||||
shell_lock_do_lock();
|
||||
}
|
||||
#endif
|
||||
|
||||
void shell_lock_do_lock(void)
|
||||
{
|
||||
_shell_is_locked = true;
|
||||
}
|
||||
|
||||
#ifdef MODULE_SHELL_LOCK_AUTO_LOCKING
|
||||
static void _shell_auto_lock_ztimer_callback(void *arg)
|
||||
{
|
||||
|
@ -12,10 +12,6 @@ CFLAGS += -DCONFIG_SHELL_LOCK_PASSWORD=\"password\"
|
||||
CFLAGS += -DCONFIG_SHELL_LOCK_AUTO_LOCK_TIMEOUT_MS=7000
|
||||
endif
|
||||
|
||||
# This config defaults to 1 on native, such that pm_off() would be called as soon as
|
||||
# shell_run_once is terminated in shell_run_forever. We do not want this behavior for this test.
|
||||
CFLAGS += -DCONFIG_SHELL_SHUTDOWN_ON_EXIT=0
|
||||
|
||||
# test_utils_interactive_sync_shell assumes that the prompt is always '> ' which breaks
|
||||
# with the password prompt of the shell_lock module which is different from the shell's prompt
|
||||
DISABLE_MODULE += test_utils_interactive_sync_shell
|
||||
|
Loading…
Reference in New Issue
Block a user