From a3487e635328cef2465cd2553159b04bc21743fb Mon Sep 17 00:00:00 2001
From: Manuel Fuhr <manuel.fuhr@student.kit.edu>
Date: Mon, 24 May 2010 12:22:25 +0200
Subject: [PATCH] Send timing information after immediately-flags.

Send FR_TIME64_IMM before FR_TIME64_SECS and FR_TIME64_TICKS so timing
information is not immdiately updates when using set_time_next_pps().
---
 host/lib/usrp/usrp2/mboard_impl.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index f17efd8..9ae6898 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -83,13 +83,13 @@ void usrp2_impl::update_clock_config(void){
 }
 
 void usrp2_impl::set_time_spec(const time_spec_t &time_spec, bool now){
-    //set ticks and seconds
-    _iface->poke32(FR_TIME64_SECS, time_spec.secs);
-    _iface->poke32(FR_TIME64_TICKS, time_spec.get_ticks(get_master_clock_freq()));
-
     //set the register to latch it all in
     boost::uint32_t imm_flags = (now)? FRF_TIME64_LATCH_NOW : FRF_TIME64_LATCH_NEXT_PPS;
     _iface->poke32(FR_TIME64_IMM, imm_flags);
+
+    //set ticks and seconds
+    _iface->poke32(FR_TIME64_SECS, time_spec.secs);
+    _iface->poke32(FR_TIME64_TICKS, time_spec.get_ticks(get_master_clock_freq()));
 }
 
 void usrp2_impl::issue_ddc_stream_cmd(const stream_cmd_t &stream_cmd){
-- 
1.5.6.5

