Revision 697dba3c core/src/aos_system.c

View differences:

core/src/aos_system.c
55 55
 */
56 56
#define SYSTEM_INFO_NAMEWIDTH         20
57 57

  
58
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
59

  
60
/**
61
 * @brief   Number of entries in the system shell input buffer.
62
 */
63
#define SYSTEM_SHELL_BUFFERENTRIES    (1 + AMIROOS_CFG_SHELL_HISTLENGTH)
64

  
65
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
66

  
58 67
/******************************************************************************/
59 68
/* EXPORTED VARIABLES                                                         */
60 69
/******************************************************************************/
......
109 118
/**
110 119
 * @brief   Shell input buffer.
111 120
 */
112
static char _shell_line[AMIROOS_CFG_SHELL_LINEWIDTH];
121
static char _shell_buffer[SYSTEM_SHELL_BUFFERENTRIES * AMIROOS_CFG_SHELL_LINEWIDTH];
113 122

  
114 123
/**
115 124
 * @brief   Shell command to retrieve system information.
......
507 516
  // print shell info
508 517
  chprintf(stream, "System shell information:\n");
509 518
  chprintf(stream, "\tcommands available:     %u\n", aosShellCountCommands(&aos.shell));
510
  chprintf(stream, "\tline width:             %u characters\n", aos.shell.input.length);
519
  chprintf(stream, "\tinput width:            %u characters\n", aos.shell.input.linewidth);
511 520
  chprintf(stream, "\tmaximum arguments:      %u\n", aos.shell.input.nargs);
521
  chprintf(stream, "\thistory size:           %u\n", aos.shell.input.nentries - 1);
512 522
#if (AMIROOS_CFG_DBG == true)
513 523
  chprintf(stream, "\tthread stack size:      %u bytes\n", aosThdGetStacksize(aos.shell.thread));
514 524
#if (CH_DBG_FILL_THREADS == TRUE)
......
709 719
 */
710 720
void aosSysInit(const char* shellPrompt)
711 721
{
722
  aosDbgCheck(shellPrompt != NULL || !AMIROOS_CFG_SHELL_ENABLE);
723

  
712 724
  /* set control thread to maximum priority */
713 725
  chThdSetPriority(AOS_THD_CTRLPRIO);
714 726

  
......
738 750

  
739 751
  /* init shell */
740 752
  aosShellInit(&aos.shell,
741
               &aos.events.os,
742 753
               shellPrompt,
743
               _shell_line,
754
               _shell_buffer,
755
               SYSTEM_SHELL_BUFFERENTRIES,
744 756
               AMIROOS_CFG_SHELL_LINEWIDTH,
745 757
               AMIROOS_CFG_SHELL_MAXARGS);
746 758
  // add system commands

Also available in: Unified diff