diff options
Diffstat (limited to 'os/various/shell.c')
-rw-r--r-- | os/various/shell.c | 66 |
1 files changed, 28 insertions, 38 deletions
diff --git a/os/various/shell.c b/os/various/shell.c index b62b8e37e..a99f2657c 100644 --- a/os/various/shell.c +++ b/os/various/shell.c @@ -35,7 +35,7 @@ #include "chprintf.h"
/**
- * @brief Shell termination event source.
+ * @brief Shell termination event source.
*/
EventSource shell_terminated;
@@ -117,7 +117,7 @@ static void cmd_systime(BaseChannel *chp, int argc, char *argv[]) { }
/**
- * @brief Array of the default commands.
+ * @brief Array of the default commands.
*/
static ShellCommand local_commands[] = {
{"info", cmd_info},
@@ -139,12 +139,12 @@ static bool_t cmdexec(const ShellCommand *scp, BaseChannel *chp, }
/**
- * @brief Shell thread function.
+ * @brief Shell thread function.
*
- * @param[in] p pointer to a @p BaseChannel object
- * @return Termination reason.
- * @retval RDY_OK terminated by command.
- * @retval RDY_RESET terminated by reset condition on the I/O channel.
+ * @param[in] p pointer to a @p BaseChannel object
+ * @return Termination reason.
+ * @retval RDY_OK terminated by command.
+ * @retval RDY_RESET terminated by reset condition on the I/O channel.
*/
static msg_t shell_thread(void *p) {
int n;
@@ -208,7 +208,7 @@ static msg_t shell_thread(void *p) { }
/**
- * @brief Shell manager initialization.
+ * @brief Shell manager initialization.
*/
void shellInit(void) {
@@ -216,16 +216,14 @@ void shellInit(void) { }
/**
- * @brief Spawns a new shell.
+ * @brief Spawns a new shell.
+ * @pre @p CH_USE_MALLOC_HEAP and @p CH_USE_DYNAMIC must be enabled.
*
- * @pre @p CH_USE_MALLOC_HEAP and @p CH_USE_DYNAMIC must be enabled.
- *
- * @param[in] scp pointer to a @p ShellConfig object
- * @param[in] size size of the shell working area to be allocated
- * @param[in] prio the priority level for the new shell
- *
- * @return A pointer to the shell thread.
- * @retval NULL thread creation failed because memory allocation.
+ * @param[in] scp pointer to a @p ShellConfig object
+ * @param[in] size size of the shell working area to be allocated
+ * @param[in] prio priority level for the new shell
+ * @return A pointer to the shell thread.
+ * @retval NULL thread creation failed because memory allocation.
*/
#if CH_USE_HEAP && CH_USE_DYNAMIC
Thread *shellCreate(const ShellConfig *scp, size_t size, tprio_t prio) {
@@ -235,14 +233,13 @@ Thread *shellCreate(const ShellConfig *scp, size_t size, tprio_t prio) { #endif
/**
- * @brief Create statically allocated shell thread.
- *
- * @param[in] scp pointer to a @p ShellConfig object
- * @param[in] wsp pointer to a working area dedicated to the shell thread stack
- * @param[in] size size of the shell working area to be allocated
- * @param[in] prio the priority level for the new shell
+ * @brief Create statically allocated shell thread.
*
- * @return A pointer to the shell thread.
+ * @param[in] scp pointer to a @p ShellConfig object
+ * @param[in] wsp pointer to a working area dedicated to the shell thread stack
+ * @param[in] size size of the shell working area
+ * @param[in] prio priority level for the new shell
+ * @return A pointer to the shell thread.
*/
Thread *shellCreateStatic(const ShellConfig *scp, void *wsp,
size_t size, tprio_t prio) {
@@ -250,22 +247,15 @@ Thread *shellCreateStatic(const ShellConfig *scp, void *wsp, return chThdCreateStatic(wsp, size, prio, shell_thread, (void *)scp);
}
-
-
-
-
-
-
/**
- * @brief Reads a whole line from the input channel.
- *
- * @param[in] chp pointer to a @p BaseChannel object
- * @param[in] line pointer to the line buffer
- * @param[in] size buffer maximum length
+ * @brief Reads a whole line from the input channel.
*
- * @return The operation status.
- * @retval TRUE the channel was reset or CTRL-D pressed.
- * @retval FALSE operation successful.
+ * @param[in] chp pointer to a @p BaseChannel object
+ * @param[in] line pointer to the line buffer
+ * @param[in] size buffer maximum length
+ * @return The operation status.
+ * @retval TRUE the channel was reset or CTRL-D pressed.
+ * @retval FALSE operation successful.
*/
bool_t shellGetLine(BaseChannel *chp, char *line, unsigned size) {
char *p = line;
|