From: Harlan Stenn Date: Mon, 30 Aug 1999 01:33:08 +0000 (-0000) Subject: ChangeLog, ntp_stdlib.h, refclock_oncore.c, refclock_parse.c: X-Git-Tag: NTP_4_0_97_D~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=caccf17738aa0efd94bda902e1fc99e795ecb3f8;p=thirdparty%2Fntp.git ChangeLog, ntp_stdlib.h, refclock_oncore.c, refclock_parse.c: * include/ntp_stdlib.h: Clean up previous NeXT patch. From: Jack Bryans * ntpd/refclock_parse.c: Permit RTS to power a DCF77. From: Carsten Paeth * ntpd/refclock_oncore.c (oncore_start): This makes the Oncore run on systems without hardpps(). From: Poul-Henning Kamp bk: 37c9df54Z9BMKVhTcS5mLWv0bK2xDg --- diff --git a/ChangeLog b/ChangeLog index dae115ff2..644941f4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +1999-08-29 Harlan Stenn + + * include/ntp_stdlib.h: Clean up previous NeXT patch. + From: Jack Bryans + + * ntpd/refclock_parse.c: Permit RTS to power a DCF77. + From: Carsten Paeth + + * ntpd/refclock_oncore.c (oncore_start): This makes the Oncore run + on systems without hardpps(). + From: Poul-Henning Kamp + 1999-08-28 Harlan Stenn * configure.in: 4.0.97c diff --git a/include/ntp_stdlib.h b/include/ntp_stdlib.h index 875075c08..3a67f52fb 100644 --- a/include/ntp_stdlib.h +++ b/include/ntp_stdlib.h @@ -10,10 +10,9 @@ /* * 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 @@ -23,10 +22,6 @@ # define __printf__ printf # endif #endif -#else -#define __format__ format -#define __printf__ printf -#endif #if defined(__STDC__) || defined(HAVE_STDARG_H) # include diff --git a/ntpd/refclock_oncore.c b/ntpd/refclock_oncore.c index 323acb901..98b49608b 100644 --- a/ntpd/refclock_oncore.c +++ b/ntpd/refclock_oncore.c @@ -459,6 +459,8 @@ oncore_start( 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); diff --git a/ntpd/refclock_parse.c b/ntpd/refclock_parse.c index 3c62234d0..670a3103c 100644 --- a/ntpd/refclock_parse.c +++ b/ntpd/refclock_parse.c @@ -613,9 +613,16 @@ static poll_info_t wsdcf_pollinfo = { WS_POLLRATE, WS_POLLCMD, WS_CMDSIZE }; * 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) @@ -1208,7 +1215,30 @@ static struct parse_clockinfo 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); @@ -5114,11 +5144,11 @@ trimbletsip_message( **/ /*-------------------------------------------------- - * 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 ) { @@ -5142,7 +5172,7 @@ rawdcf_init( } #else static int -rawdcf_init( +rawdcfdtr_init( struct parseunit *parse ) { @@ -5151,6 +5181,43 @@ rawdcf_init( } #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) */