+1999-08-29 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/ntp_stdlib.h: Clean up previous NeXT patch.
+ From: Jack Bryans <jbryans@csulb.edu>
+
+ * ntpd/refclock_parse.c: Permit RTS to power a DCF77.
+ From: Carsten Paeth <calle@calle.in-berlin.de>
+
+ * ntpd/refclock_oncore.c (oncore_start): This makes the Oncore run
+ on systems without hardpps().
+ From: Poul-Henning Kamp <phk@freebsd.org>
+
1999-08-28 Harlan Stenn <stenn@whimsy.udel.edu>
* configure.in: 4.0.97c
/*
* Handle gcc __attribute__ if available.
*/
-#ifndef NeXT
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (defined(__STRICT_ANSI__))
# define __attribute__(Spec) /* empty */
# endif
/* The __-protected variants of `format' and `printf' attributes
# define __printf__ printf
# endif
#endif
-#else
-#define __format__ format
-#define __printf__ printf
-#endif
#if defined(__STDC__) || defined(HAVE_STDARG_H)
# include <stdarg.h>
instance->pps_p.clear_offset.tv_sec = 0;
instance->pps_p.clear_offset.tv_nsec = 0;
}
+ if (time_pps_setparams(instance->pps_h, &instance->pps_p) < 0)
+ instance->pps_p.mode &= ~(PPS_HARDPPSONCLEAR|PPS_HARDPPSONASSERT);
if (time_pps_setparams(instance->pps_h, &instance->pps_p) < 0) {
perror("time_pps_setparams");
exit(1);
* RAWDCF receivers that need to be powered from DTR
* (like Expert mouse clock)
*/
-static int rawdcf_init P((struct parseunit *));
+static int rawdcfdtr_init P((struct parseunit *));
#define RAWDCFDTR_DESCRIPTION "RAW DCF77 CODE (DTR OPTION)"
-#define RAWDCFDTR_INIT rawdcf_init
+#define RAWDCFDTR_INIT rawdcfdtr_init
+
+/*
+ * RAWDCF receivers that need to be powered from RTS
+ */
+static int rawdcfrts_init P((struct parseunit *));
+#define RAWDCFRTS_DESCRIPTION "RAW DCF77 CODE (RTS OPTION)"
+#define RAWDCFRTS_INIT rawdcfrts_init
/*
* Trimble GPS receivers (TAIP and TSIP protocols)
VARITEXT_LFLAG,
VARITEXT_SAMPLES,
VARITEXT_KEEP
- }
+ },
+ { /* mode 17 */
+ RAWDCF_FLAGS,
+ NO_POLL,
+ RAWDCFRTS_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_DATA,
+ RAWDCF_ROOTDELAY,
+ RAWDCF_BASEDELAY,
+ DCF_A_ID,
+ RAWDCFRTS_DESCRIPTION,
+ RAWDCF_FORMAT,
+ DCF_TYPE,
+ RAWDCF_MAXUNSYNC,
+ RAWDCF_SPEED,
+ RAWDCF_CFLAG,
+ RAWDCF_IFLAG,
+ RAWDCF_OFLAG,
+ RAWDCF_LFLAG,
+ RAWDCF_SAMPLES,
+ RAWDCF_KEEP
+ },
};
static int ncltypes = sizeof(parse_clockinfo) / sizeof(struct parse_clockinfo);
**/
/*--------------------------------------------------
- * rawdcf_init - set up modem lines for RAWDCF receivers
+ * rawdcfdtr_init - set up modem lines for RAWDCF receivers
*/
#if defined(TIOCMSET) && (defined(TIOCM_DTR) || defined(CIOCM_DTR))
static int
-rawdcf_init(
+rawdcfdtr_init(
struct parseunit *parse
)
{
}
#else
static int
-rawdcf_init(
+rawdcfdtr_init(
struct parseunit *parse
)
{
}
#endif /* DTR initialisation type */
+/*--------------------------------------------------
+ * rawdcfrts_init - set up modem lines for RAWDCF receivers
+ */
+#if defined(TIOCMSET) && (defined(TIOCM_RTS) || defined(CIOCM_RTS))
+static int
+rawdcfrts_init(
+ struct parseunit *parse
+ )
+{
+ /*
+ * You can use the RS232 to supply the power for a DCF77 receiver.
+ * Here a voltage between the RTS and the DTR line is used.
+ */
+
+#ifdef TIOCM_RTS
+ int sl232 = TIOCM_RTS; /* turn on RTS for power supply */
+#else
+ int sl232 = CIOCM_RTS; /* turn on RTS for power supply */
+#endif
+
+ if (ioctl(parse->generic->io.fd, TIOCMSET, (caddr_t)&sl232) == -1)
+ {
+ msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init: WARNING: ioctl(fd, TIOCMSET, [C|T]IOCM_RTS): %m", CLK_UNIT(parse->peer));
+ }
+ return 0;
+}
+#else
+static int
+rawdcfrts_init(
+ struct parseunit *parse
+ )
+{
+ msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init: WARNING: OS interface incapable of setting RTS to power DCF modules", CLK_UNIT(parse->peer));
+ return 0;
+}
+#endif /* RTS initialisation type */
+
#else /* defined(REFCLOCK) && defined(PARSE) */
int refclock_parse_bs;
#endif /* defined(REFCLOCK) && defined(PARSE) */