I do an extensive use of the shell both for debug and user configuration of the application.
My aim is to print live data writing continuously into the serial device, something like this:
Code: Select all
void MyLiveCommand(BaseSequentialStream *chp, int argc, char *argv[])
{
bool stop = 0;
while(!stop)
{
chprintf(chp, "live application info\r\n");
chThdSleepMilliseconds(500);
}
}
Question: is there any way in order to set stop=TRUE from the command line typing, for instance, CTRL+C ?
The description of the shell function shellGetLine says:
Input chars are echoed on the same stream object with the
* following exceptions:
* - DEL and BS are echoed as BS-SPACE-BS.
* - CR is echoed as CR-LF.
* - 0x4 is echoed as "^D".
* - Other values below 0x20 are not echoed.
So it seems there isn't any possibility to detect extra keys combination plus a mechanism to exit from the loop.
I saw there is the symbol SHELL_CMD_EXIT_ENABLED but seems it is not related to my need.
Thank you in advance.