cmd/button: return button status
To make the button command useful in a shell script it should return the status of the button: * 0 (true) - pressed, on * 1 (false) - not pressed, off The button command takes only one argument. Correct maxargs. Adjust the Python unit test. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
This commit is contained in:
committed by
Tom Rini
parent
7cd96a4728
commit
a6bfd71a96
@@ -75,11 +75,11 @@ int do_button(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||
|
||||
ret = show_button_state(dev);
|
||||
|
||||
return 0;
|
||||
return !ret;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
button, 4, 1, do_button,
|
||||
button, 2, 1, do_button,
|
||||
"manage buttons",
|
||||
"<button_label> \tGet button state\n"
|
||||
"button list\t\tShow a list of buttons"
|
||||
|
||||
Reference in New Issue
Block a user