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.
Post Reply
sdalu
Posts: 35
Joined: Wed Dec 30, 2015 5:31 pm
Has thanked: 1 time
Been thanked: 2 times

shell info command improvement

Post by sdalu »

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: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: shell info command improvement

Post by Giovanni »

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

Post by sdalu »

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
Has thanked: 83 times
Been thanked: 67 times

Re: shell info command improvement

Post by RoccoMarco »

What about arguments?
info [rt | hal]
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: shell info command improvement

Post by Giovanni »

[rt|hal|ex|all]

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: shell info command improvement

Post by Giovanni »

bump
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: shell info command improvement

Post by RoccoMarco »

This is very interesting!
Post Reply