From bfb869111356b618e3d66a39844b89216f30ca74 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Fri, 30 Nov 2012 04:44:50 +0100 Subject: Random changes that need to be split. * 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 --- Makefile | 6 ++++++ bcm4751_gpsd.c | 6 ++++++ utils/Makefile | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 Makefile 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 #include +#include #include #include #include @@ -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 -- cgit v1.2.3