Skip to content

Conversation

@simonguinot
Copy link
Contributor

This patch introduces the "led" shell command. This allows to run the
LED API functions (and to test the LED drivers) from the Zephyr shell.
The subcommands "on", "off" and "set_brightness" are supported.

Signed-off-by: Simon Guinot simon.guinot@seagate.com

This patch introduces the "led" shell command. This allows to run the
LED API functions (and to test the LED drivers) from the Zephyr shell.
The subcommands "on", "off" and "set_brightness" are supported.

Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
@henrikbrixandersen henrikbrixandersen added area: LED Label to identify LED subsystem area: Shell Shell subsystem labels Jul 10, 2020
Copy link
Contributor

@jakub-uC jakub-uC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the types. Apart from that LGTM

shell_print(shell, "%s: setting LED %d brightness to %d",
dev->name, led, brightness);

err = led_set_brightness(dev, led, (u8_t) brightness);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use uint8_t

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jakub-uC. Thanks for the review. I apologize because I should have closed this PR. Please have a look at #26101 instead. It includes an up-to-date version of the led_shell driver.

static int cmd_on(const struct shell *shell, size_t argc, char **argv)
{
struct device *dev;
u32_t led;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use uint32_t type.

static int cmd_off(const struct shell *shell, size_t argc, char **argv)
{
struct device *dev;
u32_t led;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use uint32_t type.

};

static int parse_common_args(const struct shell *shell, char **argv,
struct device **dev, u32_t *led)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use uint32_t type.

@simonguinot
Copy link
Contributor Author

Already merged as part of PR #26101.

@simonguinot simonguinot deleted the led-shell branch October 2, 2020 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: LED Label to identify LED subsystem area: Shell Shell subsystem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants