shell: static functions cleanup
Removed shell_ prefix from static functions in .c files. Added static functions for setting and getting shell internal flags. Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
This commit is contained in:
parent
4d491b283b
commit
f7f4fe33a1
6 changed files with 531 additions and 479 deletions
|
@ -225,7 +225,7 @@ static inline u32_t shell_root_cmd_count(void)
|
|||
}
|
||||
|
||||
/* Function returning pointer to root command matching requested syntax. */
|
||||
const struct shell_cmd_entry *root_cmd_find(const char *syntax)
|
||||
const struct shell_cmd_entry *shell_root_cmd_find(const char *syntax)
|
||||
{
|
||||
const size_t cmd_count = shell_root_cmd_count();
|
||||
const struct shell_cmd_entry *cmd;
|
||||
|
@ -335,7 +335,10 @@ void shell_spaces_trim(char *str)
|
|||
}
|
||||
}
|
||||
|
||||
void shell_buffer_trim(char *buff, u16_t *buff_len)
|
||||
/** @brief Remove white chars from beginning and end of command buffer.
|
||||
*
|
||||
*/
|
||||
static void buffer_trim(char *buff, u16_t *buff_len)
|
||||
{
|
||||
u16_t i = 0U;
|
||||
|
||||
|
@ -369,3 +372,9 @@ void shell_buffer_trim(char *buff, u16_t *buff_len)
|
|||
*buff_len = *buff_len - i;
|
||||
}
|
||||
}
|
||||
|
||||
void shell_cmd_trim(const struct shell *shell)
|
||||
{
|
||||
buffer_trim(shell->ctx->cmd_buff, &shell->ctx->cmd_buff_len);
|
||||
shell->ctx->cmd_buff_pos = shell->ctx->cmd_buff_len;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue