From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Wed, 9 Jun 2010 00:27:12 -0400 Subject: [U-Boot] [PATCH v2] misc: add gpio based status led driver In-Reply-To: <1271810712-16238-1-git-send-email-thomas@wytron.com.tw> References: <1269665654-2609-1-git-send-email-thomas@wytron.com.tw> <1271810712-16238-1-git-send-email-thomas@wytron.com.tw> Message-ID: <201006090027.13751.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tuesday, April 20, 2010 20:45:12 Thomas Chou wrote: > +void __led_init(led_id_t mask, int state) > +{ > + gpio_direction_output(mask, (state == STATUS_LED_ON) ? 0 : 1); > +} > + > +void __led_set(led_id_t mask, int state) > +{ > + gpio_set_value(mask, (state == STATUS_LED_ON) ? 0 : 1); > +} are these checks correct ? "on" means a value of "1" with GPIO lines, but here you're setting the value to 0 when the state is "on". so perhaps they should both read: ..., state == STATUS_LED_ON); > +void __led_toggle(led_id_t mask) > +{ > + gpio_set_value(mask, !gpio_get_value (mask)); > +} no space before the (mask) -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/20100609/1745ab67/attachment.pgp