[Armadeus-commitlog] armadeus branch, master, updated. release-3.3-48-gf51c74f
Brought to you by:
sszy
|
From: Gwenhael <gwe...@us...> - 2010-10-08 14:16:54
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via f51c74f63182219732b914a0e2482887292f9b9f (commit)
via 93902f453bb1d8702d2b0f1f9552fcea5bde47a9 (commit)
from 8a68afd34b69368ef3e756987d29ef3c71fe532c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f51c74f63182219732b914a0e2482887292f9b9f
Merge: 93902f453bb1d8702d2b0f1f9552fcea5bde47a9 8a68afd34b69368ef3e756987d29ef3c71fe532c
Author: gwenhael <gwe...@us...>
Date: Fri Oct 8 16:16:09 2010 +0200
Merge branch 'master' of ssh://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 93902f453bb1d8702d2b0f1f9552fcea5bde47a9
Author: gwenhael <gwe...@us...>
Date: Fri Oct 8 16:15:34 2010 +0200
[DEMOS] blink_led: update the demo to be according with the actual policy gpio's driver
-----------------------------------------------------------------------
Summary of changes:
target/demos/gpio/blink_led.c | 19 +++++++------------
1 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/target/demos/gpio/blink_led.c b/target/demos/gpio/blink_led.c
index 8281e3b..c6d0521 100644
--- a/target/demos/gpio/blink_led.c
+++ b/target/demos/gpio/blink_led.c
@@ -31,11 +31,9 @@
#include <linux/ppdev.h>
#ifdef apf9328
-#define LED_GPIO_PORT "/dev/gpio/portD"
-#define LED_PIN 31
+#define LED_GPIO_PIN "/dev/gpio/PD31"
#elif apf27
-#define LED_GPIO_PORT "/dev/gpio/portF"
-#define LED_PIN 14
+#define LED_GPIO_PIN "/dev/gpio/PF14"
#else
#error Board not defined
#endif
@@ -60,34 +58,31 @@ int main(int argc, char **argv)
printf("Toggling LED %d times \n", count);
- printf("Opening %s\n", LED_GPIO_PORT);
- if ((fd = open(LED_GPIO_PORT, O_RDWR)) < 0) {
+ printf("Opening %s\n", LED_GPIO_PIN);
+ if ((fd = open(LED_GPIO_PIN, O_RDWR)) < 0) {
perror("Error");
exit(1);
}
/* Set LED PIN as GPIO; read/modify/write */
- ioctl(fd, GPIORDMODE, &portval);
- portval |= (1 << LED_PIN);
+ portval = 1;
ioctl(fd, GPIOWRMODE, &portval);
/* Set LED GPIO as output; read/modify/write */
- ioctl(fd, GPIORDDIRECTION, &portval);
- portval |= (1 << LED_PIN);
ioctl(fd, GPIOWRDIRECTION, &portval);
/* Blink the LED */
for (i = 0; i < count; i++) {
printf("Led ON\n"); /* pin <- 0 */
ioctl(fd, GPIORDDATA, &portval);
- portval &= ~(1 << LED_PIN);
+ portval &= ~1;
ioctl(fd, GPIOWRDATA, &portval);
sleep(1);
printf("Led OFF\n"); /* pin <- 1 */
ioctl(fd, GPIORDDATA, &portval);
- portval |= (1 << LED_PIN);
+ portval |= 1;
ioctl(fd, GPIOWRDATA, &portval);
sleep(1);
hooks/post-receive
--
armadeus
|