[rtems commit] timepps.h: PPS_SYNC defined by default

Sebastian Huber sebh at rtems.org
Mon May 23 07:04:27 UTC 2022


Module:    rtems
Branch:    master
Commit:    b3e4f5809d4a3b4d235cd175f39d1d95a0c2b128
Changeset: http://git.rtems.org/rtems/commit/?id=b3e4f5809d4a3b4d235cd175f39d1d95a0c2b128

Author:    Gabriel Moyano <gabriel.moyano at dlr.de>
Date:      Fri May 20 11:30:01 2022 +0200

timepps.h: PPS_SYNC defined by default

Update #2349.

---

 cpukit/include/sys/timepps.h      |  1 +
 cpukit/score/src/kern_ntptime.c   | 10 ----------
 testsuites/sptests/spntp01/init.c |  2 +-
 3 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/cpukit/include/sys/timepps.h b/cpukit/include/sys/timepps.h
index 2513298557..35dfdcbf66 100644
--- a/cpukit/include/sys/timepps.h
+++ b/cpukit/include/sys/timepps.h
@@ -26,6 +26,7 @@
 #include <sys/time.h>
 #ifdef __rtems__
 #include <rtems/score/atomic.h>
+#define	PPS_SYNC
 #endif /* __rtems__ */
 
 #define PPS_API_VERS_1	1
diff --git a/cpukit/score/src/kern_ntptime.c b/cpukit/score/src/kern_ntptime.c
index c1b4013e9b..8a16702736 100644
--- a/cpukit/score/src/kern_ntptime.c
+++ b/cpukit/score/src/kern_ntptime.c
@@ -538,16 +538,6 @@ kern_ntp_adjtime(struct thread *td, struct timex *ntv, int *retvalp)
 	ntv->jitcnt = pps_jitcnt;
 	ntv->stbcnt = pps_stbcnt;
 #endif /* PPS_SYNC */
-#ifdef __rtems__
-	ntv->ppsfreq = 0;
-	ntv->jitter = 0;
-	ntv->shift = 0;
-	ntv->stabil = 0;
-	ntv->jitcnt = 0;
-	ntv->calcnt = 0;
-	ntv->errcnt = 0;
-	ntv->stbcnt = 0;
-#endif /* __rtems__ */
 	retval = ntp_is_time_error(time_status) ? TIME_ERROR : time_state;
 	NTP_UNLOCK();
 
diff --git a/testsuites/sptests/spntp01/init.c b/testsuites/sptests/spntp01/init.c
index eeee472e9d..eb5b1ca56c 100644
--- a/testsuites/sptests/spntp01/init.c
+++ b/testsuites/sptests/spntp01/init.c
@@ -81,7 +81,7 @@ T_TEST_CASE( NTP )
   T_eq_long( tx.tolerance, 32500000 );
   T_eq_long( tx.ppsfreq, 0 );
   T_eq_long( tx.jitter, 0 );
-  T_eq_int( tx.shift, 0 );
+  T_eq_int( tx.shift, 2 );
   T_eq_long( tx.stabil, 0 );
   T_eq_long( tx.jitcnt, 0 );
   T_eq_long( tx.calcnt, 0 );



More information about the vc mailing list