-
Notifications
You must be signed in to change notification settings - Fork 8.3k
drivers: led: add shell support #25946
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
Conversation
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>
jakub-uC
left a comment
There was a problem hiding this 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use uint8_t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| static int cmd_on(const struct shell *shell, size_t argc, char **argv) | ||
| { | ||
| struct device *dev; | ||
| u32_t led; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
|
Already merged as part of PR #26101. |
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