aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-06-24 20:29:11 -0700
committerJosh Blum <josh@joshknows.com>2010-06-24 20:29:11 -0700
commit51cb8da5837adacbc626ee20aa58264e1b4b7a78 (patch)
treef83bd594377bcafd7e42b92be82ccc157f6e888c /host/lib/usrp
parentfadd3a44a84e061412accd35c1c97db820190df8 (diff)
downloaduhd-51cb8da5837adacbc626ee20aa58264e1b4b7a78.tar.gz
uhd-51cb8da5837adacbc626ee20aa58264e1b4b7a78.tar.bz2
uhd-51cb8da5837adacbc626ee20aa58264e1b4b7a78.zip
uhd: reworked time_spec_t to be more flexible: arithmetic, comparison operators...
Replaced nsecs with fractional seconds in units of seconds. Replaced nsecs and secs members with public function members. time_spec_t has a more diverse set of constructors and methods. It can handle the cases where frac secs are greater than 1 second.
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp8
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 78fc5dc23..1a0f9916b 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -84,14 +84,14 @@ void usrp2_impl::update_clock_config(void){
void usrp2_impl::set_time_spec(const time_spec_t &time_spec, bool now){
//set the ticks
- _iface->poke32(U2_REG_TIME64_TICKS, time_spec.get_ticks(get_master_clock_freq()));
+ _iface->poke32(U2_REG_TIME64_TICKS, time_spec.get_tick_count(get_master_clock_freq()));
//set the flags register
boost::uint32_t imm_flags = (now)? U2_FLAG_TIME64_LATCH_NOW : U2_FLAG_TIME64_LATCH_NEXT_PPS;
_iface->poke32(U2_REG_TIME64_IMM, imm_flags);
//set the seconds (latches in all 3 registers)
- _iface->poke32(U2_REG_TIME64_SECS, time_spec.secs);
+ _iface->poke32(U2_REG_TIME64_SECS, time_spec.get_full_secs());
}
void usrp2_impl::issue_ddc_stream_cmd(const stream_cmd_t &stream_cmd){
@@ -118,8 +118,8 @@ void usrp2_impl::issue_ddc_stream_cmd(const stream_cmd_t &stream_cmd){
(inst_chain)? 1 : 0,
(inst_reload)? 1 : 0
));
- _iface->poke32(U2_REG_RX_CTRL_TIME_SECS, stream_cmd.time_spec.secs);
- _iface->poke32(U2_REG_RX_CTRL_TIME_TICKS, stream_cmd.time_spec.get_ticks(get_master_clock_freq()));
+ _iface->poke32(U2_REG_RX_CTRL_TIME_SECS, stream_cmd.time_spec.get_full_secs());
+ _iface->poke32(U2_REG_RX_CTRL_TIME_TICKS, stream_cmd.time_spec.get_tick_count(get_master_clock_freq()));
}
/***********************************************************************