|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
16 #define printScreen(...) {chprintf (chpg, __VA_ARGS__); chprintf (chpg, "\r\n");}
23 static void cmd_info(BaseSequentialStream *lchp,
int argc,
24 const char *
const argv[]);
34 static BaseSequentialStream *
chpg;
40 #if SHELL_DYNAMIC_ENTRIES_NUMBER // compatibility with legacy static only behavior
56 streamPut(
chpg, str[i++]);
63 const char *name = argv[0];
68 if (strcasecmp(scp->
sc_name, name) == 0) {
77 if (strcasecmp(scp->
sc_name, name) == 0) {
98 const char *bit = argv[argc-1];
103 if (strstr(scp->sc_name, bit) == scp->sc_name) {
111 if (strstr(scp->sc_name, bit) == scp->sc_name) {
137 static void usage(BaseSequentialStream *lchp,
char *
p) {
144 static void cmd_info(BaseSequentialStream *lchp,
int argc,
const char *
const argv[]) {
202 const uint16_t mcu_revid = (DBGMCU->IDCODE & DBGMCU_IDCODE_REV_ID) >> 16;
203 const uint16_t mcu_devid = DBGMCU->IDCODE & DBGMCU_IDCODE_DEV_ID;
204 char *mcu_devid_str =
"not known, please fix microrlShell.c";
205 char mcu_revid_chr =
'?';
208 case 0x415 : mcu_devid_str =
"STM32L475xx/476xx/486xx devices";
210 case 0x1000 : mcu_revid_chr =
'1';
break;
211 case 0x1001 : mcu_revid_chr =
'2';
break;
212 case 0x1003 : mcu_revid_chr =
'3';
break;
213 case 0x1007 : mcu_revid_chr =
'4';
break;
216 case 0x461 : mcu_devid_str =
"STM32L496xx/4A6xx devices";
218 case 0x1000 : mcu_revid_chr =
'A';
break;
219 case 0x2000 : mcu_revid_chr =
'B';
break;
222 case 0x411 : mcu_devid_str =
"STM32F2xx and *EARLY* STM32F40x and 41x";
224 case 0x1000 : mcu_revid_chr =
'A';
break;
225 case 0x1001 : mcu_revid_chr =
'Z';
break;
226 case 0x2000 : mcu_revid_chr =
'B';
break;
227 case 0x2001 : mcu_revid_chr =
'Y';
break;
228 case 0x2003 : mcu_revid_chr =
'X';
break;
231 case 0x413 : mcu_devid_str =
"STM32F40x and 41x";
233 case 0x1000 : mcu_revid_chr =
'A';
break;
234 case 0x1001 : mcu_revid_chr =
'Z';
break;
235 case 0x1003 : mcu_revid_chr =
'1';
break;
236 case 0x1007 : mcu_revid_chr =
'2';
break;
237 case 0x100F : mcu_revid_chr =
'Y';
break;
240 case 0x419 : mcu_devid_str =
"STM32F42x and F43x";
242 case 0x1000 : mcu_revid_chr =
'A';
break;
243 case 0x1003 : mcu_revid_chr =
'Y';
break;
244 case 0x1007 : mcu_revid_chr =
'1';
break;
245 case 0x2001 : mcu_revid_chr =
'3';
break;
248 case 0x449 : mcu_devid_str =
"STM32F74x and STM32F75x";
250 case 0x1000 : mcu_revid_chr =
'A';
break;
251 case 0x1001 : mcu_revid_chr =
'Z';
break;
254 case 0x451 : mcu_devid_str =
"STM32F76x and STM32F77x";
256 case 0x1000 : mcu_revid_chr =
'A';
break;
257 case 0x1001 : mcu_revid_chr =
'Z';
break;
260 case 0x435 : mcu_devid_str =
"STM32L43x";
262 case 0x1000 : mcu_revid_chr =
'A';
break;
263 case 0x1001 : mcu_revid_chr =
'Z';
break;
266 case 0x446 : mcu_devid_str =
"STM32F303xD/E and STM32F398xE";
268 case 0x1001 : mcu_revid_chr =
'Z';
break;
269 case 0x1003 : mcu_revid_chr =
'Y';
break;
274 chprintf(lchp,
"Kernel: %s\r\n", CH_KERNEL_VERSION);
276 chprintf(lchp,
"Hal: %s\r\n", HAL_VERSION);
279 #ifdef CH_COMPILER_NAME
280 chprintf(lchp,
"Compiler: %s\r\n", CH_COMPILER_NAME);
282 #ifdef PORT_COMPILER_NAME
283 chprintf(lchp,
"Compiler: %s\r\n", PORT_COMPILER_NAME);
286 #ifdef CH_ARCHITECTURE_NAME
287 chprintf(lchp,
"Architecture: %s\r\n", CH_ARCHITECTURE_NAME);
289 #ifdef PORT_ARCHITECTURE_NAME
290 chprintf(lchp,
"Architecture: %s\r\n", PORT_ARCHITECTURE_NAME);
294 #ifdef CH_CORE_VARIANT_NAME
295 chprintf(lchp,
"Core Variant: %s\r\n", CH_CORE_VARIANT_NAME);
297 #ifdef PORT_CORE_VARIANT_NAME
298 chprintf(lchp,
"Core Variant: %s\r\n", PORT_CORE_VARIANT_NAME);
301 #pragma GCC diagnostic push
302 #pragma GCC diagnostic ignored "-Wdouble-promotion"
303 chprintf(lchp,
"Main STM32_SYSCLK frequency %.2f Mhz\r\n", STM32_SYSCLK/1e6f);
304 #pragma GCC diagnostic pop
308 chprintf(lchp,
"Port Info: %s\r\n", CH_PORT_INFO);
311 chprintf(lchp,
"Port Info: %s\r\n", PORT_INFO);
315 chprintf(lchp,
"Platform: %s\r\n", PLATFORM_NAME);
322 chprintf(lchp,
"Chip Revision: %s REV '%c' (0x%x:0x%x)\r\n", mcu_devid_str, mcu_revid_chr, mcu_devid, mcu_revid);
324 #if (!defined STM32_USE_REVISION_A_FIX) || (STM32_USE_REVISION_A_FIX == 0)
325 if ((mcu_devid == 0x413) && (mcu_revid_chr ==
'A')) {
326 chprintf(lchp,
"Chip Revision: %s REV '%c' PLEASE define STM32_USE_REVISION_A_FIX in mcuconf.h !!\r\n",
327 mcu_devid_str, mcu_revid_chr);
333 chprintf(lchp,
"Build time: %s%s%s\r\n", __DATE__,
" - ", __TIME__);
337 chprintf(lchp,
"systime= %lu\r\n", (
unsigned long)chVTGetSystemTimeX());
357 chRegSetThreadName(
"Enhanced_shell");
359 while (!chThdShouldTerminateX() && readOk) {
361 if (streamRead(
chpg, &
c, 1) == 0) {
400 #if CH_CFG_USE_HEAP && CH_CFG_USE_DYNAMIC
401 thread_t *shellCreateFromHeap(
const ShellConfig *scp,
size_t size, tprio_t prio) {
402 return chThdCreateFromHeap(NULL, size,
"shell", prio, shell_thread, (
void *)scp);
417 size_t size, tprio_t prio) {
418 return chThdCreateStatic(wsp, size, prio, shell_thread, (
void *)scp);
421 #if SHELL_DYNAMIC_ENTRIES_NUMBER
VIC slots used for the LPC2148 define name e g gps UART1_VIC_SLOT e g modem SPI1_VIC_SLOT SPI1 in mcu_periph spi_arch c or spi_slave_hs_arch c(and some others not using the SPI peripheral yet..) I2C0_VIC_SLOT 8 mcu_periph/i2c_arch.c I2C1_VIC_SLOT 9 mcu_periph/i2c_arch.c USB_VIC_SLOT 10 usb
void shellInit(void)
Shell manager initialization.
void modeAlternate(void(*funcp)(uint8_t c, uint32_t mode), uint32_t mode)
static void usage(BaseSequentialStream *lchp, char *p)
void chprintf(BaseSequentialStream *lchp, const char *fmt,...)
void(* altFunc)(uint8_t c, uint32_t mode)
thread_t * shellCreateStatic(const ShellConfig *scp, void *wsp, size_t size, tprio_t prio)
Spawns a new shell.
const char ** microrlComplet(int argc, const char *const *argv)
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
static THD_FUNCTION(shell_thread, p)
Shell thread function.
Mini printf-like functionality.
Custom command entry type.
static const ShellCommand localCommands[]
Array of the default and dynamic commands.
static AltCbParam altCbParam
static const ShellCommand * staticCommands
void microrl_set_complete_callback(microrl_t *pThis, const char **(*get_completion)(int, const char *const *))
event_source_t shell_terminated
Shell termination event source.
static pthread_mutex_t mut
void microrlExecute(int argc, const char *const *argv)
#define SHELL_DYNAMIC_ENTRIES_NUMBER
static const char * complWorlds[64]
static BaseSequentialStream * chpg
void microrl_init(microrl_t *pThis, void(*print)(const char *))
static void cmd_info(BaseSequentialStream *lchp, int argc, const char *const argv[])
shellcmd_f * sc_function
Command function.
const char * sc_name
Command name.
void microrl_set_execute_callback(microrl_t *pThis, void(*execute)(int, const char *const *))
static uint8_t mode
mode holds the current sonar mode mode = 0 used at high altitude, uses 16 wave patterns mode = 1 used...
void microrl_insert_char(microrl_t *pThis, int ch)
void microrl_set_sigint_callback(microrl_t *pThis, void(*sigintf)(void))
void microrlPrint(const char *str)