From 7e359019b88b0461ba2855800b361a2ef2c2cec0 Mon Sep 17 00:00:00 2001 From: Shigeru KANEMOTO Date: Tue, 30 Jun 2015 12:58:32 +0900 Subject: [PATCH 1/3] typo --- tools/Readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/Readme.md b/tools/Readme.md index 2e33fad..4294546 100644 --- a/tools/Readme.md +++ b/tools/Readme.md @@ -17,5 +17,5 @@ nmea2um 1. Sketch out a route in Google Earth. 2. Save the path as a KML file. 3. Load the KML file in SatGen. -4. Set the output rate at 10Hz and generate a NMEA file. -5. Conver the NMEA data to the user motion CSV format. +4. Set the output rate at 10Hz and generate an NMEA file. +5. Convert the NMEA data to the user motion CSV format. From 9738bc3952d0b589f29bf395cbc4fdd7b80a5b4d Mon Sep 17 00:00:00 2001 From: Shigeru KANEMOTO Date: Tue, 30 Jun 2015 13:10:15 +0900 Subject: [PATCH 2/3] Makefile for Linux etc. --- .gitignore | 2 ++ Makefile | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index bbf313b..88fac67 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,8 @@ *.i*86 *.x86_64 *.hex +gps-sdr-sim +gps-sdr-sim-lut # Debug files *.dSYM/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f17ddcf --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for Linux etc. + +.PHONY: all clean +all: gps-sdr-sim gps-sdr-sim-lut + +SHELL=/bin/bash +CC=gcc +CFLAGS=-fopenmp +LDFLAGS=-lm -fopenmp + +gps-sdr-sim: gpssim.o + ${CC} $< ${LDFLAGS} -o $@ + +gps-sdr-sim-lut: gpssim-lut.o + ${CC} $< ${LDFLAGS} -o $@ + +gpssim-lut.o: gpssim.c + ${CC} -c -D_SINE_LUT ${CFLAGS} $< -o $@ + +clean: + rm -f gpssim.o gpssim-lut.o gps-sdr-sim gps-sdr-sim-lut From c8402c30c50bef656d41fe1991fc4053fd83b2b6 Mon Sep 17 00:00:00 2001 From: Shigeru KANEMOTO Date: Tue, 30 Jun 2015 14:24:24 +0900 Subject: [PATCH 3/3] Correct indent Correct the indent when viewed on non- 4 letter tab editors. --- gpssim.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/gpssim.c b/gpssim.c index cca6b24..a984459 100644 --- a/gpssim.c +++ b/gpssim.c @@ -254,22 +254,22 @@ void codegen(int *ca, int prn) for (i=0; i<1023; i++) { - g1[i] = r1[9]; - g2[i] = r2[9]; - c1 = r1[2]*r1[9]; - c2 = r2[1]*r2[2]*r2[5]*r2[7]*r2[8]*r2[9]; + g1[i] = r1[9]; + g2[i] = r2[9]; + c1 = r1[2]*r1[9]; + c2 = r2[1]*r2[2]*r2[5]*r2[7]*r2[8]*r2[9]; - for (j=9; j>0; j--) + for (j=9; j>0; j--) { - r1[j] = r1[j-1]; - r2[j] = r2[j-1]; - } - r1[0] = c1; - r2[0] = c2; - } + r1[j] = r1[j-1]; + r2[j] = r2[j-1]; + } + r1[0] = c1; + r2[0] = c2; + } for (i=0,j=1023-delay[prn-1]; i<1023; i++,j++) - ca[i] = (1-g1[i]*g2[j%1023])/2; + ca[i] = (1-g1[i]*g2[j%1023])/2; return; } @@ -284,7 +284,7 @@ void date2gps(datetime_t *t, gpstime_t *g) ye = t->y - 1980; // Compute the number of leap days since Jan 5/Jan 6, 1980. - lpdays = ye/4 + 1; + lpdays = ye/4 + 1; if ((ye%4)==0 && t->m<=2) lpdays--;