[U-Boot] [RFC] Add 'led' command
Mike Frysinger
vapier at gentoo.org
Thu Nov 18 11:37:57 CET 2010
On Saturday, November 13, 2010 18:31:39 Mike Frysinger wrote:
> On Friday, November 12, 2010 09:42:52 Jason Kridner wrote:
> > On Tue, Nov 9, 2010 at 8:52 AM, Mike Frysinger wrote:
> > > On Friday, November 05, 2010 01:50:36 Jason Kridner wrote:
> > >> + if (strcmp(argv[2], "off") == 0) {
> > >> + state = 0;
> > >> + } else if (strcmp(argv[2], "on") == 0) {
> > >> + state = 1;
> > >
> > > i could have sworn we had a helper somewhere to handle "boolean
> > > strings" ...
> >
> > common/cmd_cache.c has an internal on_off function. All other places
> > seem to do individual strcmp. Let me know if you find such a helper.
> > Is there value to putting this in a function like the one in
> > cmd_cache.c?
>
> i think there's value in moving this to generalizing and moving to common
> code. there are other places where we handle env vars which could have the
> value "on" or "off".
ah, i found what i was thinking of. there is a "getenv_yesno" helper.
obviously not the same as "on/off", but should be a good model for a new
"str_onoff" helper.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101118/6f40acc3/attachment.pgp
More information about the U-Boot
mailing list