shell: Making root command a global variable

By making it global we ensure that there will not be the
same root commands.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2019-02-14 14:41:00 +01:00 committed by Anas Nashif
commit c35bb26ebd

View file

@ -143,7 +143,7 @@ struct shell_static_entry {
#define SHELL_CMD_REGISTER(syntax, subcmd, help, handler) \ #define SHELL_CMD_REGISTER(syntax, subcmd, help, handler) \
static const struct shell_static_entry UTIL_CAT(_shell_, syntax) = \ static const struct shell_static_entry UTIL_CAT(_shell_, syntax) = \
SHELL_CMD(syntax, subcmd, help, handler); \ SHELL_CMD(syntax, subcmd, help, handler); \
static const struct shell_cmd_entry UTIL_CAT(shell_cmd_, syntax) \ const struct shell_cmd_entry UTIL_CAT(shell_cmd_, syntax) \
__attribute__ ((section("." \ __attribute__ ((section("." \
STRINGIFY(UTIL_CAT(shell_root_cmd_, syntax))))) \ STRINGIFY(UTIL_CAT(shell_root_cmd_, syntax))))) \
__attribute__((used)) = { \ __attribute__((used)) = { \