I need to close the shell interface temporary and restore it later, because I need to use USART 1 (used by the shell) with another peripheral during a short delay.
Here is what I do actually :
1. I close the shell from a command, ie:
Code: Select all
static void cmd_exit_shell(BaseSequentialStream *chp, int argc, char *argv[]) //called by the shell thread
{
sdStop(&SHELL_SD); //stop serial driver used by the shell
// ..here I modify its configuration and restart it
shellExit(0); //Finally, I exit shell. method is blocking. cf doc.
}
2. When I have done my jobs, I need to restore the shell, so I do this :
Code: Select all
sdStop(&SHELL_SD);
sdStart(&SHELL_SD, &shellSerialConfig);
shellInit();
shellThread = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO); // something is wrong here, shellThread is null
But my shell is not restarted, I cannot reach my prompt like before ..
Do I something wrong ?
What is the correct way to achieve this ?
Thanks in advance
Geoffroy