]> git.sur5r.net Git - u-boot/commit
Add 'led' command
authorJason Kridner <jkridner@beagleboard.org>
Mon, 18 Apr 2011 21:22:44 +0000 (17:22 -0400)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Wed, 27 Apr 2011 17:38:05 +0000 (19:38 +0200)
commitb633f66f02ab3df6adc8fc65f13769e5fb9c328f
treec0720dddb80f62e4f6cc0376cd3d1f25428eec4b
parentcd4b8a6329072b971299a83373b6c8c2aafde44e
Add 'led' command

This patch allows any board implementing the coloured LED API
to control the LEDs from the console.

led [green | yellow | red | all ]  [ on | off ]

or

led [ 1 | 2 | 3 | all ]  [ on | off ]

Adds configuration item CONFIG_CMD_LED enabling the command.

Partially based on patch from Ulf Samuelsson:
http://www.mail-archive.com/u-boot@lists.denx.de/msg09593.html.

Updated based on feedback:
http://www.mail-archive.com/u-boot@lists.denx.de/msg41847.html
https://groups.google.com/d/topic/beagleboard/8Wf1HiK_QBo/discussion
* Fixed a handful of style issues.
* Significantly reduced the number of #ifdefs and redundant code
* Converted redundant code into loops test against a structure
* Made use of cmd_usage()
* Introduced a str_onoff() function, but haven't yet put it in common
* Eliminated trailing newline

Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
common/cmd_led.c [new file with mode: 0644]