summaryrefslogtreecommitdiff
path: root/ppsthread.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Eliminate a potential source of defects by using static mutex initialization.Eric S. Raymond2015-03-081-17/+1
|
* Decouple (mostly) the PPS thread-monitor from the session structure.Eric S. Raymond2015-03-081-81/+80
| | | | | | | | | | | | This is the big step towards ntplib. A couple of minor issues remain to be ironed out, the most significant of which is what to do about the timestamp_t type. This changes some field offsets of private fields in struct gps_device_t. Probably does not require a version bump as access to them is all through the libgpsd API. All regression tests pass. PPS observed live in gpsmon direct mode.
* Thread monitor factoring step.Eric S. Raymond2015-03-071-14/+15
| | | | All regression tests pass. PPS observed live in gpsmon.
* gpsd-report() -> gpsd_log()Eric S. Raymond2015-03-071-43/+43
| | | | | | | | | | | | | | | | This change is done so we can add a "log" hook to the pps_thread_t structure (this is not done yet) and harmonize with the name of the outer logging function. If that name had been left as gpsd_report() there would have been scope for bad confusion with the report_hook member. Also, remove two stray duplicative printf calls from the NMEA2000 driver (drivers shouldn't have printfs!) and fix one typo. This is a step towards factoring out ntplib. For that to happen, the PPS thread code needs to be decoupled from the core session structure. No logic changes. Object compatibility preserved. All regression tests pass.
* Factor PPS-related members of struct gps_device_t into a pps_thread_t structure.Eric S. Raymond2015-03-071-25/+25
| | | | | | | | | | | No logic changes, though it looks like there are two because two guards that would always have failed when the code was compiled with pps=off are now conditioned out. Also, this code is offset-preserving so as not to break link-time compatibility of libgpsd. (This is the subtler approach...) All regression tests pass.
* Revert "Another step in prying ntplib loose. Partly decouple ppsthread.c ↵Eric S. Raymond2015-03-071-23/+30
| | | | | | fom sessions." Previous approch was a bit too frontal.
* Revert "ntplib extraction requires libgpsd object format bump to 23."Eric S. Raymond2015-03-071-11/+10
| | | | We need to sneak up on this in a more subtle way.
* ntplib extraction requires libgpsd object format bump to 23.Eric S. Raymond2015-03-071-10/+11
| | | | | | The new struct ppsthread_t isolates the interface to the PPS monitor loop. It will need more members before we're done, including some reporting hooks.
* Another step in prying ntplib loose. Partly decouple ppsthread.c fom sessions.Eric S. Raymond2015-03-071-30/+23
| | | | All regression tests pass.
* Fix comment on why we may have a PPS edge, but no valid GPS time.Gary E. Miller2015-03-031-3/+4
|
* Remove unused PPS_MAX_OFFSET and PUT_MAX_OFFSETGary E. Miller2015-03-031-3/+0
|
* splint cleanup. All regression tests pass.Eric S. Raymond2015-03-021-8/+8
|
* Remove a fulfilled to-do item.Eric S. Raymond2015-03-021-2/+0
|
* Use thread_safe strerror_r(3) in ppsthread.c, not strerror(3).Eric S. Raymond2015-03-021-23/+42
|
* Use the same conditionalization for Liux everywhere - __linux__.Eric S. Raymond2015-03-021-4/+4
|
* Implement POSIX clock_gettime(3) for systems that lack it (like Mac OS X).Eric S. Raymond2015-03-011-15/+0
| | | | | | | On Mac OS X it will get proper nanosecond precision; elsewhere, only microseconds. Hides the conformance failure from the rest of the code. All regression tests pass.
* Pre-release splint/cppcheck/coverity cleanup. All regression tests pass.Eric S. Raymond2015-02-261-0/+4
|
* Was ignoring PPS if system clock slewing to faster.Gary E. Miller2015-02-231-7/+15
| | | | Also remove another double.
* Remove a precision wasting timespec to double conversion.Gary E. Miller2015-02-231-7/+11
|
* Abolish all confusing uses of the word 'drift' for a time delta.Eric S. Raymond2015-02-231-16/+16
| | | | No logic changes. All regression tesrs pass. Live PPS observed.
* Remove unused and incorrect retval from timespec_strZbigniew Chyla2015-02-151-7/+7
| | | | | | | All callers ignore value returned by timespec_str. Additionally, the function returns simply the result of snprintf(), which is not necessarily the number of chars written to the buffer (if the buffer provided by the caller was too small).
* Replace Gary's magic number 22 with TIMESPEC_LEN.Eric S. Raymond2015-02-121-1/+1
| | | | All regression tests pass.
* Trying again to expose pthread_error unconditionally enough.Eric S. Raymond2015-02-121-1/+1
|
* pyjrad_err has to be unconditionally available.Eric S. Raymond2015-02-121-2/+2
|
* Documentation comment polishing.Eric S. Raymond2015-02-121-2/+3
|
* splint cleanup. All regression tests pass.Eric S. Raymond2015-02-121-1/+5
|
* Namespace cleanup.Eric S. Raymond2015-02-121-26/+25
|
* Mutex-lock the update of last-fix time.Eric S. Raymond2015-02-121-5/+49
|
* Move a gps_report() out of a time critical area.Gary E. Miller2015-02-111-5/+6
| | | | | | gps_reqport calls a mutex and that can add large and variable delays. We are going for 1 nSec here, but likely just getting 100 nSec in the wild.
* Fix the gpsmon display-trashing problem; add some documentation and asserts.Eric S. Raymond2015-02-101-8/+8
| | | | All regression tests pass.
* cppcheck and Coverity cleanup; all regression tests pass.Eric S. Raymond2015-02-091-2/+2
|
* splint cleanup. All regressiion tests pass.Eric S. Raymond2015-02-091-1/+3
|
* Repaired a fatal typo in Gary Miller's last change.Eric S. Raymond2015-02-051-1/+1
| | | | All regression tests pass.
* Convert some of ppsthread.c to use timespec_str()Gary E. Miller2015-02-051-25/+20
| | | | | A good use case for timespec_str(), several slightly different handrolled ways to print a timespec.
* Mask a NAN in ntpshm_latch(). Cause of NAN in ppsthread.cGary E. Miller2015-02-021-0/+1
| | | | The root cause still to be found.
* Add debugging for lat_fixtime_real getting clobbered.Gary E. Miller2015-02-021-1/+13
|
* Make gpsd_report() show what it really sent to ppshook.Gary E. Miller2015-02-021-4/+5
|
* Comment possible numeric overflow in timespec_diff_ns()Gary E. Miller2015-02-021-0/+2
| | | | | timespec_diff_ns() should not be used is the delta is more than about 2 seconds.
* Fix insufficient precision in last_fixtime.clockGary E. Miller2015-02-011-2/+6
| | | | | | | | | | last_fixtime.clock and last_fixtime_clock were storing 63 bits of time in 53 bits of timestamp_t (double). Change timestamp_t to timespec to restore nSec precision. Along the way save some floating point that is slow in embedded systems that have no FPU.
* Add comment warning not to use doubles in PPS math.Gary E. Miller2015-02-011-0/+7
| | | | | | | | | WARNING! Loss of precision UNIX time to nanoSec precision is 62 significant bits UNIX time to nanoSec precision after 2038 is 63 bits a double is only 53 significant bits. You can not do PPS math with doubles
* Document thread unsafe usage of strerror() in PPS thread.Gary E. Miller2015-01-311-0/+3
| | | | strerror_r() is not a portable replacement and has its own problems.
* Fix PPS comments.Gary E. Miller2015-01-301-3/+2
| | | | | Chronyd may slew the clock rate up to 8.334%. So never fail short term time measurements seemingly off by 10% or less.
* Loosen up some 1 Hz PPS guard bands.Gary E. Miller2015-01-311-2/+8
| | | | | | | | When a Rasberry Pi starts up, its clock can be very bad until gpsd gives ntpd/chronyd enough to tame it. ntpd/chronyd have very good filters, Let them decide what time to use and not try to duplicate their.
* Add missing pthread_mutex_init(&ppslast_mutex)Gary E. Miller2015-01-301-0/+13
| | | | | No error checking was previously done on uses of ppslast_mutex. So likely the mutex has never worked, just created the odd segfault.
* Missing \n in debug statement.Gary E. Miller2015-01-301-1/+1
|
* Check return codes for pthread_mutex*() in ppsthread.cGary E. Miller2015-01-301-4/+28
| | | | Not checking returns codes is always a bad idea.
* Make PPS delivery troubleshooting a bit easier. All regression tests pass.Eric S. Raymond2015-01-271-1/+4
|
* Instrument PPS ioctl()s so we know for sure what device they're being fired at.Eric S. Raymond2015-01-271-5/+6
| | | | All regression tests pass.
* Now that the transition is done we can restore the gpsd_report name.Eric S. Raymond2014-08-271-32/+32
| | | | All regression tests pass.
* The big leap. Most instances of gpsd_report are replaced...Eric S. Raymond2014-08-271-32/+32
| | | | | | | | | | | | | | | | ...with calls to gps_notify(), which indirects to its output method through a slot in an errout structure. Usually the errout structure lives inside the session context, but because struct errout_t is its own thing this does not have to be the case. One large clique of gpsd_notify() calls, in packet.c and isgps.c, looks at a struct errout_t copy in a lexer control block This change is not complete. Remnant gpsd_report calls need to be changed, and gpsmon needs to be tweaked so that the struct_error_t in its context is a non-defaukt hook updating the cuses display rather than simply dumping to stderr. Also the report label functionality needs to be added. All regression tests pass.