summaryrefslogtreecommitdiff
path: root/timehint.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2015-04-01 11:35:07 -0700
committerGary E. Miller <gem@rellim.com>2015-04-01 11:57:52 -0700
commita8d12f28219343b2af7fd52dd57505fc427159b9 (patch)
tree6a010a907aba0acc830f66ae98834599e812a319 /timehint.c
parentb8081cbc58a0c92e876456b02d1cf43576c13a98 (diff)
downloadgpsd-a8d12f28219343b2af7fd52dd57505fc427159b9.tar.gz
Whoops, a pointer, not a pointer to a pointer.
/dev/pps0 actually seems to work.
Diffstat (limited to 'timehint.c')
-rw-r--r--timehint.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/timehint.c b/timehint.c
index 5ef60c55..a5dd0919 100644
--- a/timehint.c
+++ b/timehint.c
@@ -232,9 +232,15 @@ int ntpshm_put(struct gps_device_t *session, volatile struct shmTime *shmseg, st
#ifdef PPS_ENABLE
/* ntpd sets -20 for PPS refclocks, thus -20 precision */
- /* TODO: if PPS over USB 1.1, then precision = -10 */
- if (shmseg == session->shm_pps)
- precision = -20;
+ if (shmseg == session->shm_pps) {
+ if ( source_usb == session->sourcetype ) {
+ /* if PPS over USB 1.1, then precision = -10 */
+ precision = -10;
+ } else {
+ /* likely PPS over serial, precision = -20 */
+ precision = -20;
+ }
+ }
#endif /* PPS_ENABLE */
ntp_write(shmseg, td, precision, session->context->leap_notify);
@@ -372,17 +378,18 @@ static char *report_hook(volatile struct pps_thread_t *pps_thread,
return "no fix";
}
+ /* FIXME? how to log socket AND shm reported? */
log1 = "accepted";
if ( 0 <= session->chronyfd ) {
log1 = "accepted chrony sock";
- chrony_send(session, &td);
+ chrony_send(session, td);
}
if (session->shm_pps != NULL)
- (void)ntpshm_put(session, session->shm_pps, &td);
+ (void)ntpshm_put(session, session->shm_pps, td);
/* session context might have a hook set, too */
if (session->context->pps_hook != NULL)
- session->context->pps_hook(session, &td);
+ session->context->pps_hook(session, td);
return log1;
}