Add 'led' command
authorJason Kridner <jkridner@beagleboard.org>
Thu, 20 May 2010 10:41:26 +0000 (05:41 -0500)
committerJason Kridner <jkridner@beagleboard.org>
Tue, 8 Mar 2011 22:48:11 +0000 (16:48 -0600)
commitdae54bedf22c933cc18b8257c826b5ea7534ec4d
treef21c7d564d6c96b5e6828bb0edf2ea694efd1f01
parent49b47759bb24d5766cc24a84a7c95a4907384965
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
common/Makefile
common/cmd_led.c [new file with mode: 0644]