[Armadeus-commitlog] armadeus branch, master, updated. armadeus-4.0-2593-gf000117
Brought to you by:
sszy
|
From: Fabien M <fa...@us...> - 2011-11-30 16:35:35
|
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 f0001173855fa43e73efbb9733471a521a1dcaa2 (commit)
via 9f6c0823650285a258734c139c519a83572e2a78 (commit)
from c875ca07a443ef85563454386fba51a21533054d (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 f0001173855fa43e73efbb9733471a521a1dcaa2
Merge: 9f6c082 c875ca0
Author: Fabien Marteau <fab...@ar...>
Date: Wed Nov 30 17:34:22 2011 +0100
Merge branch 'master' of ssh://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 9f6c0823650285a258734c139c519a83572e2a78
Author: Fabien Marteau <fab...@ar...>
Date: Wed Nov 30 17:30:39 2011 +0100
[demos] quit and dirty C program example to toggle gpio (led) with as_devices lib
-----------------------------------------------------------------------
Summary of changes:
target/demos/toggle_gpio/Makefile | 7 +++++++
target/demos/toggle_gpio/toggle_gpio.c | 25 +++++++++++++++++++++++++
2 files changed, 32 insertions(+), 0 deletions(-)
create mode 100644 target/demos/toggle_gpio/Makefile
create mode 100644 target/demos/toggle_gpio/toggle_gpio.c
diff --git a/target/demos/toggle_gpio/Makefile b/target/demos/toggle_gpio/Makefile
new file mode 100644
index 0000000..fa33b98
--- /dev/null
+++ b/target/demos/toggle_gpio/Makefile
@@ -0,0 +1,7 @@
+HOST=../../../buildroot/output/host/
+STAGING_DIR=../../../buildroot/output/staging/
+CC=$(HOST)/usr/bin/arm-linux-gcc
+INCLUDE=-I$(STAGING_DIR)/usr/include/as_devices/
+
+toggle_gpio: toggle_gpio.c
+ $(CC) -Wall toggle_gpio.c -o toggle_gpio -las_devices $(INCLUDE)
diff --git a/target/demos/toggle_gpio/toggle_gpio.c b/target/demos/toggle_gpio/toggle_gpio.c
new file mode 100644
index 0000000..00d6d3a
--- /dev/null
+++ b/target/demos/toggle_gpio/toggle_gpio.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <as_gpio.h>
+
+int main(int argc, char *argv[])
+{
+ struct as_gpio_device *led;
+
+ led = as_gpio_open(174); //For apf27Dev */
+ /* led = as_gpio_open(2); //For apf51Dev */
+ if (led == NULL){
+ printf("Error: can't open gpio\n");
+ return -1;
+ }
+
+ as_gpio_set_pin_direction(led, "out");
+
+ while(1){
+ as_gpio_set_pin_value(led, 0);
+ as_gpio_set_pin_value(led, 1);
+ }
+
+ as_gpio_close(led);
+ exit(0);
+}
hooks/post-receive
--
armadeus
|