74#ifndef CONFIG_SHELL_SHUTDOWN_ON_EXIT
80# if defined(CPU_NATIVE) && !IS_ACTIVE(MODULE_SHELL_LOCK)
81# define CONFIG_SHELL_SHUTDOWN_ON_EXIT 1
83# define CONFIG_SHELL_SHUTDOWN_ON_EXIT 0
90#ifndef CONFIG_SHELL_NO_ECHO
91#define CONFIG_SHELL_NO_ECHO 0
97#ifndef CONFIG_SHELL_NO_PROMPT
98#define CONFIG_SHELL_NO_PROMPT 0
119#define SHELL_DEFAULT_BUFSIZE (128)
223 char *line_buf,
int len)
242 char *line_buf,
int len)
272 const char *filename,
unsigned *line_nr);
304#define SHELL_COMMAND(cmd, help, func) \
305 XFA_USE_CONST(shell_command_xfa_t*, shell_commands_xfa); \
306 static FLASH_ATTR const char _xfa_ ## cmd ## _cmd_name[] = #cmd; \
307 static FLASH_ATTR const char _xfa_ ## cmd ## _cmd_desc[] = help; \
308 static const shell_command_xfa_t _xfa_ ## cmd ## _cmd = { \
309 .name = _xfa_ ## cmd ## _cmd_name, \
310 .desc = _xfa_ ## cmd ## _cmd_desc, \
313 XFA_ADD_PTR(shell_commands_xfa, cmd, cmd, &_xfa_ ## cmd ## _cmd)
Utility functions, macros, and types for read-only memory.
void pm_off(void)
Turn off MCU completely.
#define FLASH_ATTR
C type qualifier required to place a variable in flash.
#define CONFIG_SHELL_SHUTDOWN_ON_EXIT
Shutdown RIOT on shell exit.
void shell_pre_command_hook(int argc, char **argv)
Optional hook before shell command is called.
int shell_handle_input_line(const shell_command_t *commands, char *line)
Parse and run a line of text as a shell command with arguments.
void shell_run_once(const shell_command_t *commands, char *line_buf, int len)
Start a shell and exit once EOF is reached.
static void shell_run_forever(const shell_command_t *commands, char *line_buf, int len)
Start a shell and restart it if it exits.
void shell_post_readline_hook(void)
Optional hook after readline has triggered.
int(* shell_command_handler_t)(int argc, char **argv)
Prototype of a shell callback handler.
static void shell_run(const shell_command_t *commands, char *line_buf, int len)
Back-porting alias for shell_run_forever.
void shell_post_command_hook(int ret, int argc, char **argv)
Optional hook after shell command is called.
int shell_parse_file(const shell_command_t *commands, const char *filename, unsigned *line_nr)
Read shell commands from a file and run them.
Common macros and compiler attributes/pragmas configuration.
#define IS_ACTIVE(macro)
Allows to verify a macro definition outside the preprocessor.
Power management interface.
A single command in the list of the supported commands.
shell_command_handler_t handler
The callback function.
const char * name
Name of the function.
const char * desc
Description to print in the "help" command.
A single command in the list of the supported commands.
FLASH_ATTR const char * name
Name of the function.
shell_command_handler_t handler
The callback function.
FLASH_ATTR const char * desc
Description to print in the "help" command.