Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't register more than 5 commands? #7

Open
xoxota99 opened this issue Sep 29, 2018 · 2 comments
Open

Can't register more than 5 commands? #7

xoxota99 opened this issue Sep 29, 2018 · 2 comments

Comments

@xoxota99
Copy link

Using Shell as a "library" within PlatformIO, I tried #define CONFIG_SHELL_MAX_COMMANDS 10 before #include <Shell.h> , but it seems like this define is either being ignored, or is somehow executed AFTER the #include. Not sure what's going on, but short of editing Shell.h, there is no way to support more than 5 shell commands. (shell_register returns false for any command beyond the first 5).

@wx4cb
Copy link

wx4cb commented Jun 24, 2019

you would need to change it in as that would be defined before your own #define

https://github.com/geekfactory/Shell/blob/master/Shell.h

@geekfactory
Copy link
Owner

As @wx4cb commented you need to edit #define CONFIG_SHELL_MAX_COMMANDS 10 in the Shell.h file inside the library.
The library was designed to allocate the memory it needs statically. Giving the user the power to change the number of commands using an API call would almost certainly require dynamic memory allocation which is not recommended in tiny embedded systems.

Regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants