Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Data Structures | |
struct | AltCbParam |
struct | ShellCommand |
Custom command entry type. More... | |
struct | ShellConfig |
Shell descriptor type. More... | |
Macros | |
#define | printScreen(...) {chprintf (chpg, __VA_ARGS__); chprintf (chpg, "\r\n");} |
#define | SHELL_DYNAMIC_ENTRIES_NUMBER 0U |
#define | shellCreate(C, S, P) shellCreateFromHeap(C, S, P) |
Typedefs | |
typedef void() | shellcmd_f(BaseSequentialStream *chp, int argc, const char *const argv[]) |
Command handler function type. More... | |
Functions | |
static void | cmd_info (BaseSequentialStream *lchp, int argc, const char *const argv[]) |
static | MUTEX_DECL (mut) |
void | microrlPrint (const char *str) |
void | microrlExecute (int argc, const char *const *argv) |
const char ** | microrlComplet (int argc, const char *const *argv) |
void | microrlSigint (void) |
static void | usage (BaseSequentialStream *lchp, char *p) |
static | THD_FUNCTION (shell_thread, p) |
Shell thread function. More... | |
void | shellInit (void) |
Shell manager initialization. More... | |
thread_t * | shellCreateStatic (const ShellConfig *scp, void *wsp, size_t size, tprio_t prio) |
Spawns a new shell. More... | |
void | modeAlternate (void(*funcp)(uint8_t c, uint32_t mode), uint32_t mode) |
void | modeShell (void) |
bool | shellGetLine (BaseSequentialStream *chp, char *line, unsigned size) |
Variables | |
void(* | AltCbParam::altFunc )(uint8_t c, uint32_t mode) |
uint32_t | AltCbParam::param |
event_source_t | shell_terminated |
Shell termination event source. More... | |
static microrl_t | rl |
static BaseSequentialStream * | chpg |
static const ShellCommand * | staticCommands = NULL |
static const char * | complWorlds [64] |
static const ShellCommand | localCommands [] |
Array of the default and dynamic commands. More... | |
static AltCbParam | altCbParam = {.altFunc = NULL, .param = 0} |
event_source_t | shell_terminated |
Shell termination event source. More... | |
struct AltCbParam |
struct ShellCommand |
Custom command entry type.
Definition at line 30 of file microrlShell.h.
Data Fields | ||
---|---|---|
shellcmd_f * | sc_function |
Command function.
|
const char * | sc_name |
Command name.
|
struct ShellConfig |
Shell descriptor type.
Definition at line 38 of file microrlShell.h.
Data Fields | ||
---|---|---|
BaseSequentialStream * | sc_channel |
I/O channel associated to the shell.
|
const ShellCommand * | sc_commands |
Shell extra commands table.
|
Definition at line 16 of file microrlShell.c.
#define SHELL_DYNAMIC_ENTRIES_NUMBER 0U |
Definition at line 15 of file microrlShell.h.
Definition at line 19 of file microrlShell.h.
typedef void() shellcmd_f(BaseSequentialStream *chp, int argc, const char *const argv[]) |
Command handler function type.
Definition at line 24 of file microrlShell.h.
|
static |
Definition at line 144 of file microrlShell.c.
References BOARD_NAME, chprintf(), STM32_SYSCLK, and usage().
const char** microrlComplet | ( | int | argc, |
const char *const * | argv | ||
) |
Definition at line 88 of file microrlShell.c.
References complWorlds, localCommands, mut, ShellCommand::sc_name, and staticCommands.
Referenced by shellInit().
void microrlExecute | ( | int | argc, |
const char *const * | argv | ||
) |
Definition at line 60 of file microrlShell.c.
References chpg, localCommands, mut, ShellCommand::sc_function, ShellCommand::sc_name, and staticCommands.
Referenced by shellInit().
void microrlPrint | ( | const char * | str | ) |
Definition at line 51 of file microrlShell.c.
References chpg.
Referenced by shellInit().
void microrlSigint | ( | void | ) |
Definition at line 131 of file microrlShell.c.
References chpg, and chprintf().
Referenced by shellInit().
Definition at line 451 of file microrlShell.c.
References altCbParam, AltCbParam::altFunc, mode, mut, and AltCbParam::param.
void modeShell | ( | void | ) |
Definition at line 459 of file microrlShell.c.
References altCbParam, AltCbParam::altFunc, mut, and printScreen.
|
static |
thread_t * shellCreateStatic | ( | const ShellConfig * | scp, |
void * | wsp, | ||
size_t | size, | ||
tprio_t | prio | ||
) |
Spawns a new shell.
CH_USE_MALLOC_HEAP
and CH_USE_DYNAMIC
must be enabled.[in] | scp | pointer to a ShellConfig object |
[in] | size | size of the shell working area to be allocated |
[in] | prio | priority level for the new shell |
NULL | thread creation failed because memory allocation. |
Create statically allocated shell thread.
[in] | scp | pointer to a ShellConfig object |
[in] | wsp | pointer to a working area dedicated to the shell thread stack |
[in] | size | size of the shell working area |
[in] | prio | priority level for the new shell |
Definition at line 412 of file microrlShell.c.
bool shellGetLine | ( | BaseSequentialStream * | chp, |
char * | line, | ||
unsigned | size | ||
) |
void shellInit | ( | void | ) |
Shell manager initialization.
Definition at line 378 of file microrlShell.c.
References microrl_init(), microrl_set_complete_callback(), microrl_set_execute_callback(), microrl_set_sigint_callback(), microrlComplet(), microrlExecute(), microrlPrint(), microrlSigint(), rl, and shell_terminated.
Referenced by shell_init_arch().
|
static |
Shell thread function.
[in] | p | pointer to a BaseSequentialStream object |
MSG_OK | terminated by command. |
RDY_RESET | terminated by reset condition on the I/O channel. |
Definition at line 350 of file microrlShell.c.
References altCbParam, AltCbParam::altFunc, chpg, microrl_insert_char(), msg, p, AltCbParam::param, printScreen, rl, shell_terminated, and staticCommands.
|
static |
Definition at line 137 of file microrlShell.c.
References chprintf(), and p.
Referenced by cmd_info(), and nps_main_parse_options().
|
static |
Definition at line 49 of file microrlShell.c.
Referenced by modeAlternate(), modeShell(), and THD_FUNCTION().
Definition at line 19 of file microrlShell.c.
Referenced by modeAlternate(), modeShell(), and THD_FUNCTION().
|
static |
Definition at line 34 of file microrlShell.c.
Referenced by microrlExecute(), microrlPrint(), microrlSigint(), and THD_FUNCTION().
|
static |
Definition at line 36 of file microrlShell.c.
Referenced by microrlComplet().
|
static |
Array of the default and dynamic commands.
Definition at line 43 of file microrlShell.c.
Referenced by microrlComplet(), and microrlExecute().
uint32_t AltCbParam::param |
Definition at line 20 of file microrlShell.c.
Referenced by modeAlternate(), and THD_FUNCTION().
|
static |
Definition at line 33 of file microrlShell.c.
Referenced by shellInit(), and THD_FUNCTION().
event_source_t shell_terminated |
Shell termination event source.
Definition at line 30 of file microrlShell.c.
Referenced by shellInit(), and THD_FUNCTION().
|
extern |
Shell termination event source.
Definition at line 30 of file microrlShell.c.
Referenced by shellInit(), and THD_FUNCTION().
|
static |
Definition at line 35 of file microrlShell.c.
Referenced by microrlComplet(), microrlExecute(), and THD_FUNCTION().