aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp1
diff options
context:
space:
mode:
authorThomas Tsou <ttsou@vt.edu>2010-08-16 17:03:06 -0700
committerThomas Tsou <ttsou@vt.edu>2010-08-16 18:42:58 -0700
commit43e5480dee9f6068ffe84bf1b86526189043ee87 (patch)
treeaae8369b8f3fea9ec1a987ca05bdaffc8cebcb3e /host/lib/usrp/usrp1
parentcc6bbf949f8e4eabefdccf8d8cc4d9ed803ce40e (diff)
downloaduhd-43e5480dee9f6068ffe84bf1b86526189043ee87.tar.gz
uhd-43e5480dee9f6068ffe84bf1b86526189043ee87.tar.bz2
uhd-43e5480dee9f6068ffe84bf1b86526189043ee87.zip
usrp1: Remove hard coded clock values
Get clock values from clock control, where the master setting lives.
Diffstat (limited to 'host/lib/usrp/usrp1')
-rw-r--r--host/lib/usrp/usrp1/dsp_impl.cpp10
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.hpp2
2 files changed, 6 insertions, 6 deletions
diff --git a/host/lib/usrp/usrp1/dsp_impl.cpp b/host/lib/usrp/usrp1/dsp_impl.cpp
index 260c01ea8..0db3cb473 100644
--- a/host/lib/usrp/usrp1/dsp_impl.cpp
+++ b/host/lib/usrp/usrp1/dsp_impl.cpp
@@ -36,7 +36,7 @@ void usrp1_impl::rx_dsp_init(void)
boost::bind(&usrp1_impl::rx_dsp_get, this, _1, _2),
boost::bind(&usrp1_impl::rx_dsp_set, this, _1, _2));
- rx_dsp_set(DSP_PROP_HOST_RATE, double(64e6/10)); //FIXME magic number
+ rx_dsp_set(DSP_PROP_HOST_RATE, _clock_ctrl->get_master_clock_freq() / 16);
}
/***********************************************************************
@@ -95,7 +95,9 @@ void usrp1_impl::rx_dsp_set(const wax::obj &key, const wax::obj &val)
switch(key.as<dsp_prop_t>()) {
case DSP_PROP_FREQ_SHIFT: {
double new_freq = val.as<double>();
- _iface->poke32(FR_RX_FREQ_0, compute_freq_word(64e6, new_freq)); //FIXME magic rate
+ boost::uint32_t hw_freq_word = compute_freq_word(
+ _clock_ctrl->get_master_clock_freq(), new_freq);
+ _iface->poke32(FR_RX_FREQ_0, hw_freq_word);
_tx_dsp_freq = new_freq;
return;
}
@@ -130,7 +132,7 @@ void usrp1_impl::tx_dsp_init(void)
boost::bind(&usrp1_impl::tx_dsp_set, this, _1, _2));
//initial config and update
- tx_dsp_set(DSP_PROP_HOST_RATE, double(64e6/10)); //FIXME magic number
+ tx_dsp_set(DSP_PROP_HOST_RATE, _clock_ctrl->get_master_clock_freq() * 2 / 16);
}
/***********************************************************************
@@ -152,7 +154,7 @@ void usrp1_impl::tx_dsp_get(const wax::obj &key, wax::obj &val)
return;
case DSP_PROP_CODEC_RATE:
- val = MASTER_CLOCK_RATE;
+ val = _clock_ctrl->get_master_clock_freq() * 2;
return;
case DSP_PROP_HOST_RATE:
diff --git a/host/lib/usrp/usrp1/usrp1_impl.hpp b/host/lib/usrp/usrp1/usrp1_impl.hpp
index 5166f989f..f57f9a09a 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.hpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.hpp
@@ -33,8 +33,6 @@
#ifndef INCLUDED_USRP1_IMPL_HPP
#define INCLUDED_USRP1_IMPL_HPP
-static const double MASTER_CLOCK_RATE = 64e6; //TODO get from clock control
-
/*!
* Simple wax obj proxy class:
* Provides a wax obj interface for a set and a get function.