diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> | 2012-11-30 04:44:50 +0100 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> | 2012-11-30 18:45:00 +0100 |
commit | bfb869111356b618e3d66a39844b89216f30ca74 (patch) | |
tree | 6195b43fafe8f5c4764c9c3e0967a789f7e8987f | |
parent | 45837f126cf5a5e5726a030d5aaa5f7d2e037e20 (diff) | |
download | bcm4751-bfb869111356b618e3d66a39844b89216f30ca74.tar.gz bcm4751-bfb869111356b618e3d66a39844b89216f30ca74.tar.bz2 bcm4751-bfb869111356b618e3d66a39844b89216f30ca74.zip |
Random changes that need to be split.gnutoo/garbage
* make it compile under GNU/Linux for android thanks to -static
* make it work again after starting it once already
(shuts down the GPS before powering it up)
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | bcm4751_gpsd.c | 6 | ||||
-rw-r--r-- | utils/Makefile | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a83ab1d --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +all: bcm4751_gpsd + +bcm4751_gpsd: meif.c bcm4751_gpsd.c + $(CC) -static -o $@ $^ +clean: + rm -f bcm4751_gpsd diff --git a/bcm4751_gpsd.c b/bcm4751_gpsd.c index d14667c..4b88295 100644 --- a/bcm4751_gpsd.c +++ b/bcm4751_gpsd.c @@ -24,6 +24,7 @@ #include <termios.h> #include <errno.h> +#include <asm-generic/ioctls.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> @@ -285,6 +286,11 @@ int main(void) int fd = -1; int rc = -1; + printf("Turning the GPS off...\n"); + rc = sec_gps_power(0); + if(rc < 0) { + printf("Warning: Failed to turn the GPS off!\n"); + } printf("Turning the GPS on...\n"); rc = sec_gps_power(1); if(rc < 0) { diff --git a/utils/Makefile b/utils/Makefile index eb48aed..108fbef 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -1,6 +1,6 @@ all: gps-test-crespo gps-test-crespo: bcm4751_test.c - $(CC) -o $@ $^ + $(CC) -static -o $@ $^ clean: rm -f gps-test-crespo |