diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2005-05-25 14:38:37 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2005-05-25 14:38:37 +0000 |
commit | b0554b4411443e203f98ebefb5bf46a2388d0a75 (patch) | |
tree | cf702e67d58737b822032e81ccdcd049b48dfb63 | |
parent | efb0c81d002a087b905147de37d25410dedcab66 (diff) | |
download | gpsd-b0554b4411443e203f98ebefb5bf46a2388d0a75.tar.gz |
Rob Janssen's fix for PPS threading.
-rw-r--r-- | gpsd.c | 5 | ||||
-rw-r--r-- | gpsd.h | 10 | ||||
-rw-r--r-- | libgpsd_core.c | 2 | ||||
-rw-r--r-- | ntpshm.c | 5 | ||||
-rw-r--r-- | sirfmon.c | 16 | ||||
-rw-r--r-- | www/index.html.in | 11 |
6 files changed, 33 insertions, 16 deletions
@@ -59,6 +59,9 @@ static struct gps_context_t context = {0, LEAP_SECONDS, CENTURY_BASE, #ifdef NTPSHM_ENABLE {0}, {0}, +# ifdef PPS_ENABLE + 0, +# endif /* PPS_ENABLE */ #endif /* NTPSHM_ENABLE */ }; @@ -919,7 +922,7 @@ int main(int argc, char *argv[]) #ifdef NTPSHM_ENABLE nice(-10); /* for precise timekeeping, increase priority */ - ntpshm_init(&context); + ntpshm_init(&context,nowait); #endif /* NTPSHM_ENABLE */ /* make default devices accessible even after we drop privileges */ @@ -36,6 +36,9 @@ struct gps_context_t { #ifdef NTPSHM_ENABLE struct shmTime *shmTime[NTPSHMSEGS]; int shmTimeInuse[NTPSHMSEGS]; +# ifdef PPS_ENABLE + int shmTimePPS; +# endif /* PPS_ENABLE */ #endif /* NTPSHM_ENABLE */ }; @@ -108,6 +111,9 @@ struct gps_device_t { #ifdef SIRFII_ENABLE unsigned long satcounter; #endif /* SIRFII_ENABLE */ +#ifdef TSIP_ENABLE + time_t last_request; /* Last time a packets were sent */ +#endif /* SIRFII_ENABLE */ #ifdef GARMIN_ENABLE /* private housekeeping stuff for the Garmin driver */ void *GarminBuffer; /* Pointer Garmin packet buffer void *, to keep the packet details out of the @@ -138,7 +144,7 @@ struct gps_device_t { int shmTime; # ifdef PPS_ENABLE int shmTimeP; -# endif /* NTPSHM_ENABLE */ +# endif /* PPS_ENABLE */ #endif /* NTPSHM_ENABLE */ }; @@ -174,7 +180,7 @@ extern void gpsd_binary_quality_dump(struct gps_device_t *, char *); extern int netlib_connectsock(const char *, const char *, const char *); -extern int ntpshm_init(struct gps_context_t *); +extern int ntpshm_init(struct gps_context_t *, int); extern int ntpshm_alloc(struct gps_context_t *context); extern int ntpshm_free(struct gps_context_t *context, int segment); extern int ntpshm_put(struct gps_device_t *, double); diff --git a/libgpsd_core.c b/libgpsd_core.c index c6b41860..70f926a6 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -174,7 +174,7 @@ int gpsd_activate(struct gps_device_t *session) #ifdef NTPSHM_ENABLE session->shmTime = ntpshm_alloc(session->context); #if defined(PPS_ENABLE) && defined(TIOCMIWAIT) - if (session->shmTime >= 0) { + if (session->shmTime >= 0 && session->context->shmTimePPS) { if ((session->shmTimeP = ntpshm_alloc(session->context)) >= 0) pthread_create(&pt,NULL,gpsd_ppsmonitor, (void *)session); } @@ -65,7 +65,7 @@ static struct shmTime *getShmTime(int unit) /* attach all NTP SHM segments. called once at startup, while still root */ -int ntpshm_init(struct gps_context_t *context) +int ntpshm_init(struct gps_context_t *context, int enablepps) { int i; @@ -73,6 +73,9 @@ int ntpshm_init(struct gps_context_t *context) context->shmTime[i] = getShmTime(i); memset(context->shmTimeInuse,0,sizeof(context->shmTimeInuse)); +# ifdef PPS_ENABLE + context->shmTimePPS = enablepps; +# endif /* PPS_ENABLE */ return 1; } @@ -103,11 +103,11 @@ static WINDOW *mid19win, *mid27win, *cmdwin, *debugwin; #define SIRF_PACKET 1 #define NMEA_PACKET 2 -/****************************************************************************** +/***************************************************************************** * * NMEA command composition * - ******************************************************************************/ + *****************************************************************************/ static void nmea_add_checksum(char *sentence) /* add NMEA checksum to a possibly *-terminated sentence */ @@ -146,11 +146,11 @@ static int nmea_send(int fd, const char *fmt, ... ) } } -/****************************************************************************** +/***************************************************************************** * * SiRF packet-decoding routines * - ******************************************************************************/ + *****************************************************************************/ static void decode_time(int week, int tow) { @@ -537,11 +537,11 @@ static void decode_sirf(unsigned char buf[], int len) wprintw(debugwin, "\n"); } -/****************************************************************************** +/***************************************************************************** * * Serial-line handling * - ******************************************************************************/ + *****************************************************************************/ static int get_speed(struct termios* ttyctl) { @@ -792,11 +792,11 @@ static int sendpkt(unsigned char *buf, int len) return (write(gps_fd,buf,len) == len); } -/****************************************************************************** +/***************************************************************************** * * Main sequence and display machinery * - ******************************************************************************/ + *****************************************************************************/ static int tzoffset(void) { diff --git a/www/index.html.in b/www/index.html.in index 960e262b..82cd122d 100644 --- a/www/index.html.in +++ b/www/index.html.in @@ -172,6 +172,9 @@ GPS</a> receivers.</p> <p>We supply a Gentoo Linux <a href="gpsd.ebuild">ebuild script</a>.</p> +<p>You can find Debian-stable packages +<a href='http://packages.debian.org/unstable/misc/gpsd'>here</a>.</p> + <h1 id='others'>Other GPSDs</h1> <p>There are two Linux-based forks of <code>gpsd</code> in the wild, but @@ -202,9 +205,11 @@ program that simulates the output of a GPS in motion, and can be used for testing GPS-aware applications.</p> <p>We aren't Green Parrot Software Development, nor are we the -Greenville Public School District or the Greater Peoria Sanitary -District, nor do we have anything to do with the General Product -Safety Directive.</p> +Greenville Public School District nor the Greater Peoria Sanitary +District, nor even the Greater Portland Soccer District, nor the Green +Party of San Diego, nor do we have anything to do with the General +Product Safety Directive, the the Guiding Principles of Sustainable +Design, nor the Glatt Plagiarism Self-Detection Program.</p> </div> <hr/> |