[Armadeus-commitlog] armadeus branch, master, updated. release-3.4-202-g104c6a0
Brought to you by:
sszy
|
From: Fabien M <fa...@us...> - 2011-06-20 14:12:33
|
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 104c6a0bac75724b6a1617489e679178f0d50b22 (commit)
via f759082ac0bbb9a310bfb03ff073880bfd7a49ab (commit)
via 3785d2cbbf22f3b0866124bb87383afc1535c322 (commit)
via 464a6c631db78446df2562f37f19d84332d7860a (commit)
from 588d00ca4a0f39cffdf1ec10b47077020728c06e (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 104c6a0bac75724b6a1617489e679178f0d50b22
Merge: f759082ac0bbb9a310bfb03ff073880bfd7a49ab 588d00ca4a0f39cffdf1ec10b47077020728c06e
Author: Fabien Marteau <fab...@ar...>
Date: Mon Jun 20 16:12:04 2011 +0200
Merge branch 'master' of ssh://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit f759082ac0bbb9a310bfb03ff073880bfd7a49ab
Author: Fabien Marteau <fab...@ar...>
Date: Mon Jun 20 16:10:44 2011 +0200
[buildroot][package][straton_ios] fill io profile for led and button on apf27
commit 3785d2cbbf22f3b0866124bb87383afc1535c322
Author: Fabien Marteau <fab...@ar...>
Date: Mon Jun 20 16:10:18 2011 +0200
[buildroot][package][straton_ios] change profile name
commit 464a6c631db78446df2562f37f19d84332d7860a
Author: Fabien Marteau <fab...@ar...>
Date: Mon Jun 20 16:08:25 2011 +0200
[buildroot][package][straton_ios] adding as_devices references
-----------------------------------------------------------------------
Summary of changes:
target/packages/straton_ios/Makefile | 5 ++-
target/packages/straton_ios/armadeus.XL5 | 31 +++++++++++++++++++++
target/packages/straton_ios/straton_ios.c | 42 +++++++++++++++++++++++++---
target/packages/straton_ios/straton_ios.h | 2 +-
4 files changed, 72 insertions(+), 8 deletions(-)
create mode 100755 target/packages/straton_ios/armadeus.XL5
diff --git a/target/packages/straton_ios/Makefile b/target/packages/straton_ios/Makefile
index e373060..59e3293 100644
--- a/target/packages/straton_ios/Makefile
+++ b/target/packages/straton_ios/Makefile
@@ -6,18 +6,19 @@ LIB_VERS=1
STAT_LIB=$(LIBRARY).a
SONAME=lib$(LIBRARY).so
LIBNAME=$(SONAME).$(LIB_VERS)
+INCLUDE=-I$(STAGING_DIR)/usr/include/as_devices/
ARCHIVE_CMD=ar
ARCHIVE_OPTS=-cvq
$(LIBNAME): $(OBJ)
- $(CC) -shared -Wl,-soname,$(SONAME) -o $(SONAME) $(OBJ)
+ $(CC) -shared -Wl,-soname,$(SONAME) -o $(SONAME) $(OBJ) -las_devices
ln -sf $(SONAME) $(LIBNAME)
$(STAT_LIB): $(OBJ)
$(ARCHIVE_CMD) $(ARCHIVE_OPTS) $(STAT_LIB) $(OBJ)
%.o: %.c
- $(CC) -fPIC -o $@ -c $< $(CFLAGS) -I./include/ -I$(STAGING_DIR)/usr/include/as_devices/
+ $(CC) -fPIC -o $@ -c $< $(CFLAGS) $(INCLUDE)
clean:
rm -f $(OBJ) $(BINARY) $(LIBNAME) $(SONAME)
diff --git a/target/packages/straton_ios/armadeus.XL5 b/target/packages/straton_ios/armadeus.XL5
new file mode 100755
index 0000000..2749a4e
--- /dev/null
+++ b/target/packages/straton_ios/armadeus.XL5
@@ -0,0 +1,31 @@
+$K5LMEXPORT
+$DIR
+PR=APF51,APF51 board
+PR=APF27,APF27 board
+PR=DEMO,HMS Demo Board
+$END
+$DEF(PR=APF27)
+VAR Type : DINT := 0; (*kind of IO
+<< 0 = LED >>
+<< 1 = BUTTON >>
+*)
+VAR Index : DINT; (*channel number or HMS offset*)
+$END
+$DEF(PR=APF51)
+VAR Type : DINT := 0; (*kind of IO
+<< 0 = LED >>
+<< 1 = BUTTON >>
+*)
+VAR Index : DINT; (*channel number or HMS offset*)
+$END
+$DEF(PR=DEMO)
+VAR Type : DINT := 0; (*kind of IO
+<< 0 = DI >>
+<< 1 = DO >>
+<< 2 = Meter >>
+<< 3 = Rotate button >>
+<< 4 = HMS-IN >>
+<< 5 = HMS-OUT >>
+*)
+VAR Index : DINT; (*channel number or HMS offset*)
+$END
diff --git a/target/packages/straton_ios/straton_ios.c b/target/packages/straton_ios/straton_ios.c
index 180aaa2..58f8e11 100755
--- a/target/packages/straton_ios/straton_ios.c
+++ b/target/packages/straton_ios/straton_ios.c
@@ -1,25 +1,58 @@
+#include <stdio.h>
+#include <stdlib.h>
#include "straton_ios.h"
#include <as_gpio.h>
+static struct as_gpio_device *led;
+static struct as_gpio_device *button;
+
+
+
/* set and get specifics functions */
void led_setvalue(long value) {
+ if (value = 0)
+ as_gpio_set_pin_value(led, 0);
+ else
+ as_gpio_set_pin_value(led, 1);
return;
}
long button_getvalue(void){
- return 0;
+ return (long)as_gpio_get_pin_value(button);
}
/* straton api */
int straton_ios_init(void) {
/* init BUTTON */
+ button = as_gpio_open('F', 13);
+ if (button == NULL) {
+ printf("IO error: Can't initialize button\n");
+ goto error;
+ }
+ as_gpio_set_pin_direction(button, "in");
+
/* init LED */
+ led = as_gpio_open('F', 14);
+ if (led == NULL) {
+ printf("IO error: Can't initialize led\n");
+ goto close_button_error;
+ }
return 0;
+ as_gpio_set_pin_direction(led, "out");
+
+/*close_led_error:*/
+ as_gpio_close(led);
+close_button_error:
+ as_gpio_close(button);
+error:
+ return -1;
}
void straton_ios_close(void) {
- /* init BUTTON */
- /* init LED */
+ /* close BUTTON */
+ as_gpio_close(button);
+ /* close LED */
+ as_gpio_close(led);
return;
}
@@ -39,9 +72,8 @@ int straton_ios_exchange(str_param *pParams, int index,
case IO_BUTTON:
*value_out = button_getvalue();
return EXCHANGE_GET;
- default :
+ default :
return -1;
}
return 0;
-
}
diff --git a/target/packages/straton_ios/straton_ios.h b/target/packages/straton_ios/straton_ios.h
index 39ef43d..c26ec1e 100644
--- a/target/packages/straton_ios/straton_ios.h
+++ b/target/packages/straton_ios/straton_ios.h
@@ -1,4 +1,4 @@
-#define PROFIL_NAME "DEMO"
+#define PROFIL_NAME "APF27"
/* IO TYPE */
#define IO_LED 0
hooks/post-receive
--
armadeus
|