diff options
author | Fred Wright <fw@fwright.net> | 2016-12-22 17:32:45 -0800 |
---|---|---|
committer | Fred Wright <fw@fwright.net> | 2016-12-22 17:32:45 -0800 |
commit | 79c69b2b12e5f8ee3aa3f50b8886a0a7bbdd73f7 (patch) | |
tree | 4144ed2bf859363b996af60e1ae3dcaec69da875 /gpsmon.c | |
parent | d1fd9ad44f320235b4d449988570ab5633f21bab (diff) | |
download | gpsd-79c69b2b12e5f8ee3aa3f50b8886a0a7bbdd73f7.tar.gz |
Makes MAGIC_HAT kludge optional.
This adds a build option called 'magic_hat', and makes the code for
MAGIC_HAT_GPS and MAGIC_LINK_GPS conditional on it. It currently
defaults to True on Linux and False otherwise. It's meaningless on
non-Linux platforms, though at present there are no
conditionally-present options, so this one is also present on all
platforms.
TESTED:
Tested on a Beaglebone Black with suitable symlinks added (and running
a kernel with PPS_CLIENT_KTIMER turned off. Verified that the kludge
behaves as intended when enabled, and is inoperative when disabled.
Diffstat (limited to 'gpsmon.c')
-rw-r--r-- | gpsmon.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1318,6 +1318,7 @@ int main(int argc, char **argv) /* this guard suppresses a warning on Bluetooth devices */ if (session.sourcetype == source_rs232 || session.sourcetype == source_usb) { session.pps_thread.report_hook = pps_report; + #ifdef MAGIC_HAT_ENABLE /* * The HAT kludge. If we're using the HAT GPS on a * Raspberry Pi or a workalike like the ODROIDC2, and @@ -1326,8 +1327,9 @@ int main(int argc, char **argv) */ if ((strcmp(session.pps_thread.devicename, MAGIC_HAT_GPS) == 0 || strcmp(session.pps_thread.devicename, MAGIC_LINK_GPS) == 0) - && access("/dev/pps0", R_OK | W_OK) == 0) - session.pps_thread.devicename = "/dev/pps0"; + && access("/dev/pps0", R_OK | W_OK) == 0) + session.pps_thread.devicename = "/dev/pps0"; + #endif /* MAGIC_HAT_GPS && MAGIC_LINK_GPS */ pps_thread_activate(&session.pps_thread); } #endif /* PPS_ENABLE */ |