aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/db_xcvr2450.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/dboard/db_xcvr2450.cpp')
-rw-r--r--host/lib/usrp/dboard/db_xcvr2450.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp
index efe7687c2..3bf866fc8 100644
--- a/host/lib/usrp/dboard/db_xcvr2450.cpp
+++ b/host/lib/usrp/dboard/db_xcvr2450.cpp
@@ -89,7 +89,7 @@ static const uhd::dict<std::string, gain_range_t> xcvr_rx_gain_ranges = map_list
**********************************************************************/
class xcvr2450 : public xcvr_dboard_base{
public:
- xcvr2450(ctor_args_t const& args);
+ xcvr2450(ctor_args_t args);
~xcvr2450(void);
void rx_get(const wax::obj &key, wax::obj &val);
@@ -152,7 +152,7 @@ private:
/***********************************************************************
* Register the XCVR 2450 dboard
**********************************************************************/
-static dboard_base::sptr make_xcvr2450(dboard_base::ctor_args_t const& args){
+static dboard_base::sptr make_xcvr2450(dboard_base::ctor_args_t args){
return dboard_base::sptr(new xcvr2450(args));
}
@@ -165,7 +165,7 @@ UHD_STATIC_BLOCK(reg_xcvr2450_dboard){
/***********************************************************************
* Structors
**********************************************************************/
-xcvr2450::xcvr2450(ctor_args_t const& args) : xcvr_dboard_base(args){
+xcvr2450::xcvr2450(ctor_args_t args) : xcvr_dboard_base(args){
//enable only the clocks we need
this->get_iface()->set_clock_enabled(dboard_iface::UNIT_TX, true);
@@ -263,7 +263,7 @@ void xcvr2450::set_lo_freq(double target_freq){
for(R = 1; R <= 7; R++){
double N = (target_freq*scaler*R*_ad9515div)/ref_freq;
intdiv = int(std::floor(N));
- fracdiv = (N - intdiv)*double(1 << 16);
+ fracdiv = boost::math::iround((N - intdiv)*double(1 << 16));
//actual minimum is 128, but most chips seems to require higher to lock
if (intdiv < 131 or intdiv > 255) continue;
//constraints met: exit loop
@@ -344,8 +344,8 @@ static int gain_to_tx_vga_reg(float &gain){
//calculate the actual gain value
if (reg < 4) gain = 0;
- else if (reg < 48) gain = reg/2 - 1;
- else gain = reg/2.0 - 1.5;
+ else if (reg < 48) gain = float(reg/2 - 1);
+ else gain = float(reg/2.0 - 1.5);
//return register value
return reg;
@@ -385,7 +385,7 @@ static max2829_regs_t::tx_baseband_gain_t gain_to_tx_bb_reg(float &gain){
*/
static int gain_to_rx_vga_reg(float &gain){
int reg = std::clip(boost::math::iround(gain/2.0), 0, 31);
- gain = reg*2;
+ gain = float(reg*2);
return reg;
}
@@ -444,7 +444,7 @@ void xcvr2450::rx_get(const wax::obj &key_, wax::obj &val){
//handle the get request conditioned on the key
switch(key.as<subdev_prop_t>()){
case SUBDEV_PROP_NAME:
- val = dboard_id::to_string(get_rx_id());
+ val = get_rx_id().to_pp_string();
return;
case SUBDEV_PROP_OTHERS:
@@ -542,7 +542,7 @@ void xcvr2450::tx_get(const wax::obj &key_, wax::obj &val){
//handle the get request conditioned on the key
switch(key.as<subdev_prop_t>()){
case SUBDEV_PROP_NAME:
- val = dboard_id::to_string(get_tx_id());
+ val = get_tx_id().to_pp_string();
return;
case SUBDEV_PROP_OTHERS: