[Armadeus-commitlog] armadeus branch, master, updated. release-3.2-8-g46244b5
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2009-12-03 17:47:16
|
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 46244b562c4cfaf4810117db549962b2ff7ea749 (commit)
via 5b1ca71d174f17ac8dbd00e59397db9e2b0d399c (commit)
via 2c7773fd50cf9f7785972c7ee05645b3511a6864 (commit)
via 39b3849ecbd1c466897a8d577eef0ce5d8fe6a5c (commit)
from 88bc49fe0f3651040c5fe87b663db3aee8c95aca (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 46244b562c4cfaf4810117db549962b2ff7ea749
Author: Julien Boibessot <jul...@ar...>
Date: Thu Dec 3 18:46:42 2009 +0100
[GIT] Ignore modified .so in target/packages/....
commit 5b1ca71d174f17ac8dbd00e59397db9e2b0d399c
Author: Julien Boibessot <jul...@ar...>
Date: Thu Dec 3 18:45:52 2009 +0100
[OTHERS] Minor changes to AsDevice lib
commit 2c7773fd50cf9f7785972c7ee05645b3511a6864
Merge: 39b3849ecbd1c466897a8d577eef0ce5d8fe6a5c 88bc49fe0f3651040c5fe87b663db3aee8c95aca
Author: Julien Boibessot <jul...@ar...>
Date: Thu Dec 3 18:02:30 2009 +0100
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 39b3849ecbd1c466897a8d577eef0ce5d8fe6a5c
Author: Julien Boibessot <jul...@ar...>
Date: Thu Dec 3 14:32:45 2009 +0100
[BUILDROOT] Improve GPM installation
-----------------------------------------------------------------------
Summary of changes:
patches/buildroot/085-adds_gpm_package.patch | 68 +++++++++++++++++++++-----
target/packages/.gitignore | 1 +
target/packages/as_devices/c/Makefile | 2 +-
target/packages/as_devices/c/as_93lcxx.c | 36 ++++++++------
target/packages/as_devices/c/as_93lcxx.h | 4 +-
target/packages/as_devices/c/as_spi.c | 40 +++++++++------
6 files changed, 104 insertions(+), 47 deletions(-)
diff --git a/patches/buildroot/085-adds_gpm_package.patch b/patches/buildroot/085-adds_gpm_package.patch
index 62c4695..c81f81a 100644
--- a/patches/buildroot/085-adds_gpm_package.patch
+++ b/patches/buildroot/085-adds_gpm_package.patch
@@ -1,7 +1,11 @@
+Add GPM (General Purpose Mouse server) to Buildroot.
+
+Signed-off-by: Julien Boibessot <jul...@ar...>
+
Index: buildroot/package/gpm/Config.in
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ buildroot/package/gpm/Config.in 2009-09-25 14:03:49.000000000 +0200
++++ buildroot/package/gpm/Config.in 2009-12-03 12:15:44.000000000 +0100
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_GPM
+ bool "gpm mouse server"
@@ -9,12 +13,12 @@ Index: buildroot/package/gpm/Config.in
+ gpm means general purpose mouse and is the mouse support for Linux
+ in the console.
+
-+ http://unix.schottelius.org/gpm/
++ http://www.nico.schottelius.org/software/gpm/
Index: buildroot/package/gpm/gpm.mk
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ buildroot/package/gpm/gpm.mk 2009-09-25 14:03:49.000000000 +0200
-@@ -0,0 +1,11 @@
++++ buildroot/package/gpm/gpm.mk 2009-12-03 11:58:49.000000000 +0100
+@@ -0,0 +1,18 @@
+#############################################################
+#
+# General Purpose Mouse server for Linux console.
@@ -24,17 +28,22 @@ Index: buildroot/package/gpm/gpm.mk
+GPM_VERSION:=1.20.6
+GPM_SOURCE:=gpm-$(GPM_VERSION).tar.bz2
+GPM_SITE:=http://unix.schottelius.org/gpm/archives/
++GPM_INSTALL_STAGING:=YES
++GPM_INSTALL_TARGET:=YES
+
+$(eval $(call AUTOTARGETS,package,gpm))
++
++$(GPM_HOOK_POST_INSTALL): $(GPM_TARGET_INSTALL_TARGET)
++ $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/sbin/gpm
++ touch $@
++
Index: buildroot/package/gpm/gpm-1.20.6-removes_obsolete_functions.patch
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ buildroot/package/gpm/gpm-1.20.6-removes_obsolete_functions.patch 2009-09-25 14:03:49.000000000 +0200
-@@ -0,0 +1,79 @@
-+
-+Removes all "obsolete" functions (at least to compile for uClibc).
++++ buildroot/package/gpm/gpm-1.20.6-removes_obsolete_functions.patch 2009-12-03 11:33:41.000000000 +0100
+@@ -0,0 +1,77 @@
+
-+Signed-off-by: Julien Boibessot <jul...@ar...>
++Replaces all "obsolete" functions (at least to compile for uClibc).
+
+diff -urN gpm-1.20.6/src/daemon/old_main.c gpm-1.20.6.mod/src/daemon/old_main.c
+--- gpm-1.20.6/src/daemon/old_main.c 2009-02-09 10:58:53.000000000 +0100
@@ -112,9 +121,9 @@ Index: buildroot/package/gpm/gpm-1.20.6-removes_obsolete_functions.patch
+ gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid",
Index: buildroot/package/Config.in
===================================================================
---- buildroot.orig/package/Config.in 2009-09-25 14:05:19.000000000 +0200
-+++ buildroot/package/Config.in 2009-09-25 14:06:07.000000000 +0200
-@@ -267,6 +267,7 @@
+--- buildroot.orig/package/Config.in 2009-12-03 11:19:50.000000000 +0100
++++ buildroot/package/Config.in 2009-12-03 11:22:53.000000000 +0100
+@@ -259,6 +259,7 @@
source "package/fpgaregs/Config.in"
source "package/fuse/Config.in"
source "package/gadgetfs-test/Config.in"
@@ -122,3 +131,38 @@ Index: buildroot/package/Config.in
source "package/hal/Config.in"
if !BR2_PACKAGE_BUSYBOX_HIDE_OTHERS
source "package/hdparm/Config.in"
+Index: buildroot/package/gpm/gpm-1.20.6-removes_strip_from_install.patch
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ buildroot/package/gpm/gpm-1.20.6-removes_strip_from_install.patch 2009-12-03 11:33:54.000000000 +0100
+@@ -0,0 +1,30 @@
++GPM asks "install" to strip the executables while installing it.
++This doesn't seems cross-compiling friendly, so remove the option (-s) and let
++the strip be done elsewhere.
++
++Index: gpm-1.20.6/Makefile.include.in
++===================================================================
++--- gpm-1.20.6.orig/Makefile.include.in 2009-12-03 11:25:30.000000000 +0100
+++++ gpm-1.20.6/Makefile.include.in 2009-12-03 11:26:32.000000000 +0100
++@@ -54,7 +54,7 @@
++ DVIPS = @DVIPS@
++ MAKEINFO = @MAKEINFO@
++ TEXI2HTML = texi2html
++-STRIP = -s
+++STRIP =
++
++ AR = ar
++ ETAGS = etags
++Index: gpm-1.20.6/src/Makefile.in
++===================================================================
++--- gpm-1.20.6.orig/src/Makefile.in 2009-12-03 11:26:01.000000000 +0100
+++++ gpm-1.20.6/src/Makefile.in 2009-12-03 11:26:42.000000000 +0100
++@@ -48,7 +48,7 @@
++
++ DEFS = @DEFS@
++
++-STRIP = -s
+++STRIP =
++
++ ### BUILD PROCESS
++
diff --git a/target/packages/.gitignore b/target/packages/.gitignore
index 5761abc..bae14b5 100644
--- a/target/packages/.gitignore
+++ b/target/packages/.gitignore
@@ -1 +1,2 @@
*.o
+*.so*
diff --git a/target/packages/as_devices/c/Makefile b/target/packages/as_devices/c/Makefile
index b78f67c..e2fcea2 100644
--- a/target/packages/as_devices/c/Makefile
+++ b/target/packages/as_devices/c/Makefile
@@ -22,7 +22,7 @@ ARCHIVE_OPTS=-cvq
${LIBNAME}: ${OBJ}
${CC} -shared -Wl,-soname,${SONAME} -o ${SONAME} ${OBJ} -lc
- ln -s ${SONAME} ${LIBNAME}
+ ln -sf ${SONAME} ${LIBNAME}
${STAT_LIB}: ${OBJ}
${ARCHIVE_CMD} ${ARCHIVE_OPTS} ${STAT_LIB} ${OBJ}
diff --git a/target/packages/as_devices/c/as_93lcxx.c b/target/packages/as_devices/c/as_93lcxx.c
index a3f613b..5f48a1a 100644
--- a/target/packages/as_devices/c/as_93lcxx.c
+++ b/target/packages/as_devices/c/as_93lcxx.c
@@ -18,12 +18,13 @@
*
*/
-#include "as_93lcxx.h"
-#include "as_spi.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
+#include "as_93lcxx.h"
+#include "as_spi.h"
+
/* define start bits + opcode */
#define READ (6)
#define EWEN (4)
@@ -43,12 +44,12 @@
#define TEC (6*MS)
#define TWL (15*MS)
-/** @brief Private functions to ease making spi instructions
- */
-uint8_t address_len(uint8_t aType, uint8_t aWord_size)
+/** @brief private function to ease making spi instructions
+ */
+static uint8_t address_len(uint8_t aType, uint8_t aWord_size)
{
- switch(aType)
+ switch (aType)
{
case 46:
if (aWord_size == 16)
@@ -66,6 +67,7 @@ uint8_t address_len(uint8_t aType, uint8_t aWord_size)
}
}
+
struct as_93lcxx_device * as_93lcxx_open(unsigned char *aSpidev_filename,
uint8_t aType,
uint32_t aSpeed,
@@ -76,13 +78,15 @@ struct as_93lcxx_device * as_93lcxx_open(unsigned char *aSpidev_filename,
/* open spidev bus */
fd = as_spi_open(aSpidev_filename);
- if (fd < 0)
+ if (fd < 0) {
+ perror("Can't open spi device");
return NULL;
+ }
/* verify datas */
if (!( (aType == 46) || (aType == 56) || (aType == 66)))
return NULL;
- if ( (aWord_size < 1) || (aWord_size > 16))
+ if ((aWord_size < 1) || (aWord_size > 16))
return NULL;
dev = (struct as_93lcxx_device *)malloc(sizeof(struct as_93lcxx_device));
@@ -110,7 +114,7 @@ int32_t as_93lcxx_read(struct as_93lcxx_device *aDev, uint16_t aAddress)
uint32_t data_out,msg=0;
int add_length;
- add_length = address_len(aDev->type,aDev->word_size);
+ add_length = address_len(aDev->type, aDev->word_size);
/* forge message */
msg = ((READ << (add_length+ (aDev->word_size)))
@@ -131,7 +135,7 @@ int32_t as_93lcxx_ewen(struct as_93lcxx_device *aDev)
uint32_t msg=0;
int add_length;
- add_length = address_len(aDev->type,aDev->word_size);
+ add_length = address_len(aDev->type, aDev->word_size);
/* forge message */
msg = ((EWEN << add_length)
@@ -149,7 +153,7 @@ int32_t as_93lcxx_erase(struct as_93lcxx_device *aDev, uint16_t aAddress)
uint32_t msg=0;
int add_length;
- add_length = address_len(aDev->type,aDev->word_size);
+ add_length = address_len(aDev->type, aDev->word_size);
/* forge message */
msg = ((ERASE << (add_length + aDev->word_size))
@@ -169,7 +173,7 @@ int32_t as_93lcxx_erase_all(struct as_93lcxx_device *aDev)
uint32_t msg=0;
int add_length;
- add_length = address_len(aDev->type,aDev->word_size);
+ add_length = address_len(aDev->type, aDev->word_size);
/* forge message */
msg = ((ERAL << add_length)
@@ -193,7 +197,7 @@ int32_t as_93lcxx_write(struct as_93lcxx_device *aDev,
uint32_t msg=0;
int add_length;
- add_length = address_len(aDev->type,aDev->word_size);
+ add_length = address_len(aDev->type, aDev->word_size);
/* forge message */
msg = ((WRITE << (add_length+ (aDev->word_size)))
@@ -217,7 +221,7 @@ int32_t as_93lcxx_write_all(struct as_93lcxx_device *aDev,
uint32_t msg=0;
int add_length;
- add_length = address_len(aDev->type,aDev->word_size);
+ add_length = address_len(aDev->type, aDev->word_size);
/* forge message */
msg = ((WRAL << (add_length+ (aDev->word_size)))
@@ -240,7 +244,7 @@ int32_t as_93lcxx_ewds(struct as_93lcxx_device *aDev)
uint32_t msg=0;
int add_length;
- add_length = address_len(aDev->type,aDev->word_size);
+ add_length = address_len(aDev->type, aDev->word_size);
/* forge message */
msg = ((EWDS << add_length)
@@ -250,7 +254,7 @@ int32_t as_93lcxx_ewds(struct as_93lcxx_device *aDev)
as_spi_msg(aDev->fd, msg,
3 + add_length,
aDev->speed);
+
return 0;
}
-
diff --git a/target/packages/as_devices/c/as_93lcxx.h b/target/packages/as_devices/c/as_93lcxx.h
index d9d72e4..4e43523 100644
--- a/target/packages/as_devices/c/as_93lcxx.h
+++ b/target/packages/as_devices/c/as_93lcxx.h
@@ -138,6 +138,6 @@ int32_t as_93lcxx_ewds(struct as_93lcxx_device *aDev);
#ifdef __cplusplus
}
-#endif // __cplusplus
+#endif /* __cplusplus */
-#endif // AS_93LCXX_H_
+#endif /* AS_93LCXX_H_ */
diff --git a/target/packages/as_devices/c/as_spi.c b/target/packages/as_devices/c/as_spi.c
index bed8bc2..966e0f9 100644
--- a/target/packages/as_devices/c/as_spi.c
+++ b/target/packages/as_devices/c/as_spi.c
@@ -18,7 +18,6 @@
*
*/
-#include "as_spi.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@@ -32,15 +31,19 @@
#include <linux/types.h>
#include <linux/spi/spidev.h>
+#include "as_spi.h"
+
int as_spi_open(const unsigned char *spidev_name)
{
int fd;
+
fd = open((char *)spidev_name, O_RDWR);
if (fd < 0) {
perror("open");
return -1;
}
+
return fd;
}
@@ -76,6 +79,7 @@ int as_spi_get_mode(int fd)
perror("SPI rd_mode");
return -1;
}
+
return mode;
}
@@ -94,20 +98,24 @@ int as_spi_get_lsb(int fd)
int as_spi_get_bits_per_word(int fd)
{
uint8_t bits;
+
if (ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits) < 0) {
perror("SPI bits_per_word");
- return-1;
+ return -1;
}
+
return bits;
}
int as_spi_get_speed(int fd)
{
uint8_t speed;
+
if (ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed) < 0) {
perror("SPI max_speed_hz");
return -1;
}
+
return speed;
}
@@ -119,7 +127,7 @@ uint32_t as_spi_msg(int aFd,
uint32_t msg;
int len;
- struct spi_ioc_transfer xfer[1];
+ struct spi_ioc_transfer xfer[1];
unsigned char buf[32];
unsigned char buf_read[32];
@@ -129,24 +137,26 @@ uint32_t as_spi_msg(int aFd,
msg = aMsg;
len = aLen;
- msg = msg<<1;/* XXX Last bit is always read at 0 */
- len = len+1; /* XXX */
+ msg = msg << 1;/* XXX Last bit is always read at 0 */
+ len = len + 1; /* XXX */
- memset(xfer, 0, sizeof xfer);
- memset(buf, 0, sizeof buf);
- memset(buf_read, 0, sizeof buf_read);
+ memset(xfer, 0, sizeof(xfer));
+ memset(buf, 0, sizeof(buf));
+ memset(buf_read, 0, sizeof(buf_read));
- if (len >= sizeof buf)
- len = (sizeof buf)-1;
- for (i = len;i > 0;i--)
+ if (len >= sizeof(buf)) {
+ len = sizeof(buf) - 1;
+ }
+
+ for (i=len; i>0; i--)
{
buf[i-1] = msg & 0x01;
msg = msg >> 1;
}
- xfer[0].tx_buf = buf;
+ xfer[0].tx_buf = (uint32_t)buf;
xfer[0].len = len;
- xfer[0].rx_buf = buf_read;
+ xfer[0].rx_buf = (uint32_t)buf_read;
xfer[0].speed_hz = aSpeed;
xfer[0].bits_per_word = 1;
@@ -157,7 +167,7 @@ uint32_t as_spi_msg(int aFd,
}
msg = msg | buf_read[0];
- for (i = 1;i < len;i++)
+ for (i=1; i<len; i++)
{
msg = msg << 1;
msg = msg | buf_read[i];
@@ -171,5 +181,3 @@ void as_spi_close(int fd)
return;
}
-
-
hooks/post-receive
--
armadeus
|