aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/utils/algorithm.hpp4
-rw-r--r--host/lib/ic_reg_maps/gen_ad9777_regs.py6
-rw-r--r--host/lib/usrp/dboard/db_rfx.cpp4
3 files changed, 7 insertions, 7 deletions
diff --git a/host/include/uhd/utils/algorithm.hpp b/host/include/uhd/utils/algorithm.hpp
index cc935b226..8fe9cde82 100644
--- a/host/include/uhd/utils/algorithm.hpp
+++ b/host/include/uhd/utils/algorithm.hpp
@@ -55,8 +55,8 @@ namespace std{
return 0;
}
- template<class T, class T1, class T2> T clip(T val, T1 minVal, T2 maxVal){
- return std::min<T>(std::max<T>(val, minVal), maxVal);
+ template<class T> T clip(T val, T minVal, T maxVal){
+ return std::min(std::max(val, minVal), maxVal);
}
}//namespace std
diff --git a/host/lib/ic_reg_maps/gen_ad9777_regs.py b/host/lib/ic_reg_maps/gen_ad9777_regs.py
index 135d5c724..6077b61b6 100644
--- a/host/lib/ic_reg_maps/gen_ad9777_regs.py
+++ b/host/lib/ic_reg_maps/gen_ad9777_regs.py
@@ -129,13 +129,13 @@ struct ad9777_regs_t{
#end for
}
- boost::uint32_t get_reg(boost::uint8_t addr){
- boost::uint32_t reg = 0;
+ boost::uint8_t get_reg(boost::uint8_t addr){
+ boost::uint8_t reg = 0;
switch(addr){
#for $addr in sorted(set(map(lambda r: r.get_addr(), $regs)))
case $addr:
#for $reg in filter(lambda r: r.get_addr() == addr, $regs)
- reg |= (boost::uint32_t($reg.get_name()) & $reg.get_mask()) << $reg.get_shift();
+ reg |= (boost::uint8_t($reg.get_name()) & $reg.get_mask()) << $reg.get_shift();
#end for
break;
#end for
diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp
index 3f318d3ed..11a689b20 100644
--- a/host/lib/usrp/dboard/db_rfx.cpp
+++ b/host/lib/usrp/dboard/db_rfx.cpp
@@ -175,10 +175,10 @@ void rfx_xcvr::set_rx_ant(const std::string &ant){
void rfx_xcvr::set_rx_pga0_gain(float gain){
//clip the input
- gain = std::clip(gain, 0, _max_rx_pga0_gain);
+ gain = std::clip<float>(gain, 0, _max_rx_pga0_gain);
//voltage level constants
- static const float max_volts = .2, min_volts = 1.2;
+ static const float max_volts = float(.2), min_volts = float(1.2);
static const float slope = (max_volts-min_volts)/_max_rx_pga0_gain;
//calculate the voltage for the aux dac