drivers: gpio: shell: make blink command optional

Adds CONFIG_GPIO_SHELL_BLINK_CMD symbol.
Saves around 300 bytes when command is disabled.

Signed-off-by: Nick Ward <nix.ward@gmail.com>
This commit is contained in:
Nick Ward 2023-10-22 18:00:35 +11:00 committed by Carles Cufí
parent 695a0ac503
commit 45509fdc0e
2 changed files with 10 additions and 1 deletions

View file

@ -29,6 +29,15 @@ config GPIO_SHELL_INFO_CMD
This command provides a shell user extra information about gpio
controller reserved pins and line names.
config GPIO_SHELL_BLINK_CMD
bool "GPIO Shell blink command"
default y
depends on GPIO_SHELL
help
Enable GPIO Shell blink command.
This command provides a shell user the ability to 'blink' a pin
at 1Hz.
config GPIO_INIT_PRIORITY
int "GPIO init priority"
default KERNEL_INIT_PRIORITY_DEFAULT

View file

@ -574,7 +574,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(sub_gpio,
SHELL_CMD_ARG(set, &sub_gpio_dev,
"Set GPIO pin value\n"
"Usage: gpio set <device> <pin> <level 0|1>", cmd_gpio_set, 4, 0),
SHELL_CMD_ARG(blink, &sub_gpio_dev,
SHELL_COND_CMD_ARG(CONFIG_GPIO_SHELL_BLINK_CMD, blink, &sub_gpio_dev,
"Blink GPIO pin\n"
"Usage: gpio blink <device> <pin>", cmd_gpio_blink, 3, 0),
SHELL_COND_CMD_ARG(CONFIG_GPIO_SHELL_INFO_CMD, info, &sub_gpio_dev,