[LinuxPPS] LinuxPPS - odd behaviour. (Please Read)

Udo van den Heuvel udovdh at xs4all.nl
Thu Nov 8 19:25:58 CET 2007


Udo van den Heuvel wrote:
> Rodolfo Giometti wrote:
>> By using "main" and "alternate" devices.
> 
> For refclock_atom:
> 
> How would I call the devices?
> 
> /dev/pps0 and ..... ?
> /dev/ppssource?

A patch attached.
It just opens /dev/ppssource and forgets about the file handle for now.
(bad?)

Please test! (does atom run solo now?)
-------------- next part --------------
--- org.ntp-4.2.4p2/ntpd/refclock_atom.c	2006-06-06 22:16:48.000000000 +0200
+++ ntp-4.2.4p2/ntpd/refclock_atom.c	2007-11-08 19:23:07.000000000 +0100
@@ -79,6 +79,7 @@
  */
 #ifdef HAVE_PPSAPI
 #define DEVICE		"/dev/pps%d" /* device name and unit */
+#define SOURCEDEVICE	"/dev/ppssource%d" /* device name and unit */
 #endif /* HAVE_PPSAPI */
 
 #define	PRECISION	(-20)	/* precision assumed (about 1 us) */
@@ -171,6 +172,9 @@
 	memset(up, 0, sizeof(struct ppsunit));
 	pp->unitptr = (caddr_t)up;
 
+	(void) sprintf(device, SOURCEDEVICE, unit);
+	up->fddev = open(device, O_RDWR);
+	
 	/*
 	 * Open PPS device. This can be any serial or parallel port and
 	 * not necessarily the port used for the associated radio.


More information about the LinuxPPS mailing list