]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ChangeLog, ntp_stdlib.h, refclock_oncore.c, refclock_parse.c:
authorHarlan Stenn <stenn@ntp.org>
Mon, 30 Aug 1999 01:33:08 +0000 (01:33 -0000)
committerHarlan Stenn <stenn@ntp.org>
Mon, 30 Aug 1999 01:33:08 +0000 (01:33 -0000)
  * 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>

bk: 37c9df54Z9BMKVhTcS5mLWv0bK2xDg

ChangeLog
include/ntp_stdlib.h
ntpd/refclock_oncore.c
ntpd/refclock_parse.c

index dae115ff27bce2acea3267a7ea8a44f509fb811a..644941f4fd01453166ed0686efb963ad5446dd02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+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
index 875075c0813226e55a3c084199f386b808e1abdc..3a67f52fb39cf32c23c770d771fb8ad17c8eefe8 100644 (file)
 /*
  * 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>
index 323acb9019375c6322034b24b7ea4d808f018e05..98b49608b1988b6dc78f1485bf7a918a9cdd02ff 100644 (file)
@@ -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);
index 3c62234d053fbc82770c0b1813fccd4ef59172e4..670a3103c290d5b4d9927affa7ac285e02170c58 100644 (file)
@@ -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) */