shell info command improvement

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
sdalu
Posts: 35
Joined: Wed Dec 30, 2015 5:31 pm
Has thanked: 1 time
Been thanked: 2 times

shell info command improvement

Postby sdalu » Thu Jul 28, 2016 3:27 pm

Hi

It would be nice to have the "info" command listing the hal drivers that have been compiled in, something like:

Code: Select all

  chprintf(chp, "HAL drivers: %s"SHELL_NEWLINE_STR,
      ""
#if defined(HAL_USE_RTC) && HAL_USE_RTC
      " RTC"
#endif
#if defined(HAL_USE_PAL) && HAL_USE_PAL
      " PAL"
#endif

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: shell info command improvement

Postby Giovanni » Thu Jul 28, 2016 3:29 pm

Not a bad idea, some configuration options could also be listed.

Giovanni

sdalu
Posts: 35
Joined: Wed Dec 30, 2015 5:31 pm
Has thanked: 1 time
Been thanked: 2 times

Re: shell info command improvement

Postby sdalu » Thu Jul 28, 2016 3:41 pm

Also it would be very convenient if it was possible to extend the info command with new information, perhaps something like

shell_cmd.h

Code: Select all

#if defined(SHELL_CMD_INFO_EXTRA)
SHELL_CMD_INFO_EXTRA(BaseSequentialStream *chp, int argc, char *argv[]);
#endif


shell_cmd.c

Code: Select all

static void cmd_info(BaseSequentialStream *chp, int argc, char *argv[]) {

// ....

#if defined(SHELL_CMD_INFO_EXTRA)
SHELL_CMD_INFO_EXTRA(chp, argc, argv);
#endif
}

User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Location: Munich (Germany)
Has thanked: 83 times
Been thanked: 67 times
Contact:

Re: shell info command improvement

Postby RoccoMarco » Thu Jul 28, 2016 5:05 pm

What about arguments?
info [rt | hal]
Ciao,
RM

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: shell info command improvement

Postby Giovanni » Thu Jul 28, 2016 5:11 pm

[rt|hal|ex|all]

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: shell info command improvement

Postby Giovanni » Tue Apr 25, 2017 9:25 am

bump

User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Location: Munich (Germany)
Has thanked: 83 times
Been thanked: 67 times
Contact:

Re: shell info command improvement

Postby RoccoMarco » Wed Jun 07, 2017 9:40 pm

This is very interesting!
Ciao,
RM


Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 29 guests