I am having doubts about getting more data through the serial port after entering a function called by the shell.
Ex:
Code: Select all
static const ShellCommand commands[] =
{
{ "read", cmd_read },
{ NULL, NULL } };
Static void cmd_read (BaseSequentialStream * chp, int argc, char * argv [])
{
Static uint8_t buf [16];
(Void) argc;
(Void) argv;
Do something ...
Wait while number of bytes smaller than buffer size
Read_serial (& SD2, buf, sizeof buf);
Chprintf (chp, "% s \ r \ n", buf);
}
In other words, I enter the function and wait for a given number of bytes.