RTEMS Shell

Joel Sherrill joel.sherrill at OARcorp.com
Wed Jan 13 22:29:06 UTC 2010


On 01/13/2010 03:27 PM, rtwas wrote:
> Hello,
>
> I'm wanting to add *multiple* user commands to Rtems Shell. The examples
> show
> how to add *one* command but do not show how to add *n* commands.
>
> To the point, to add a single command (after defining the function) one
> does:
>
>
> "#define CONFIGURE_SHELL_USER_COMMANDS&Shell_USERCMD_Command"
>
>
> where "Shell_USERCMD_Command" is a structure describing the function.
> The only
> way I can see to add multiple commands is to define separate structures
> and add
> multiple pointers to the "CONFIGURE_SHELL_USER_COMMANDS" macro ie.,
>
> "#define CONFIGURE_SHELL_USER_COMMANDS&Shell_USERCMD0_Command
> &Shell_USERCMD1_Command.."
>
> or some how make use of the "next" entry in the "rtems_shell_cmd_t"
> struct to create
> a linked list of commands. The docs are not clear here.
>
>    

 From a user application I helped with that added a set
of custom commands for a multi-IO PC-104 board.

#define CONFIGURE_PCMMIO_COMMANDS \
&Shell_PCMMIO_DIN_Command, \
&Shell_PCMMIO_DOUT_Command, \
&Shell_PCMMIO_ADC_Command, \
&Shell_PCMMIO_DAC_Command, \
&Shell_PCMMIO_IRQ_Command, \
&Shell_PCMMIO_Benchmark_Command

#define CONFIGURE_SHELL_USER_COMMANDS \
   CONFIGURE_PCMMIO_COMMANDS

> Another question, can one put this is a separate "C" file? Many of the
> macros are used to
> simply initialize the the RTEMS Shell but that seems to want to be in
> "main.c". The example
> in:
>
> "http://rtems.org/onlinedocs/releases/rtemsdocs-4.9.3/share/rtems/html/shell/shell00008.html"
>
> shows the user command text wrapped in:
>
> "#include<rtems/shell.h>"
>
> and
>
> "#include<rtems/shellconfig.h>"
>
> along with things like:
>
>
> #define CONFIGURE_SHELL_COMMANDS_INIT
> #define CONFIGURE_SHELL_COMMANDS_ALL
> #define CONFIGURE_SHELL_MOUNT_MSDOS
>
> in between.
>
>
>
>    
I think you should be able to have a "shell_config.c" and
do it there.   It is based on confdefs.h and I know you can
do that with confdefs.h.

--joel
> Help appreciated.
>
> Robert W.
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users
>    


-- 
Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985





More information about the users mailing list