Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Mar 2015 08:34:49 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r279773 - head/sys/dev/usb/serial
Message-ID:  <201503080834.t288Ynds091682@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Sun Mar  8 08:34:49 2015
New Revision: 279773
URL: https://svnweb.freebsd.org/changeset/base/279773

Log:
  Switch polarity of PPS events.
  
  PR:		196897
  Submitted by:	ian @
  MFC after:	1 week

Modified:
  head/sys/dev/usb/serial/usb_serial.c

Modified: head/sys/dev/usb/serial/usb_serial.c
==============================================================================
--- head/sys/dev/usb/serial/usb_serial.c	Sun Mar  8 07:40:40 2015	(r279772)
+++ head/sys/dev/usb/serial/usb_serial.c	Sun Mar  8 08:34:49 2015	(r279773)
@@ -1102,14 +1102,19 @@ ucom_cfg_status_change(struct usb_proc_m
 	sc->sc_msr = new_msr;
 	sc->sc_lsr = new_lsr;
 
-	/* time pulse counting support */
+	/*
+	 * Time pulse counting support. Note that both CTS and DCD are
+	 * active-low signals. The status bit is high to indicate that
+	 * the signal on the line is low, which corresponds to a PPS
+	 * clear event.
+	 */
 	switch(ucom_pps_mode) {
 	case 1:
 		if ((sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) &&
 		    (msr_delta & SER_CTS)) {
 			pps_capture(&sc->sc_pps);
 			pps_event(&sc->sc_pps, (sc->sc_msr & SER_CTS) ?
-			    PPS_CAPTUREASSERT : PPS_CAPTURECLEAR);
+			    PPS_CAPTURECLEAR : PPS_CAPTUREASSERT);
 		}
 		break;
 	case 2:
@@ -1117,7 +1122,7 @@ ucom_cfg_status_change(struct usb_proc_m
 		    (msr_delta & SER_DCD)) {
 			pps_capture(&sc->sc_pps);
 			pps_event(&sc->sc_pps, (sc->sc_msr & SER_DCD) ?
-			    PPS_CAPTUREASSERT : PPS_CAPTURECLEAR);
+			    PPS_CAPTURECLEAR : PPS_CAPTUREASSERT);
 		}
 		break;
 	default:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503080834.t288Ynds091682>