summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/common
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-11-15 14:54:18 -0800
committerJosh Blum <josh@joshknows.com>2011-11-15 14:54:18 -0800
commit317bff29a5358c7bfc576359ab5a3b3fcf30ad10 (patch)
treef08b092049c9dc33786088c62d9baf689622ab66 /host/lib/usrp/common
parentff2e730a0dc7f67241942143c120e02a838f932e (diff)
downloaduhd-317bff29a5358c7bfc576359ab5a3b3fcf30ad10.tar.gz
uhd-317bff29a5358c7bfc576359ab5a3b3fcf30ad10.tar.bz2
uhd-317bff29a5358c7bfc576359ab5a3b3fcf30ad10.zip
uhd: added freq options and common gain setter
Diffstat (limited to 'host/lib/usrp/common')
-rw-r--r--host/lib/usrp/common/apply_corrections.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/host/lib/usrp/common/apply_corrections.cpp b/host/lib/usrp/common/apply_corrections.cpp
index e3ec9baab..6aee00753 100644
--- a/host/lib/usrp/common/apply_corrections.cpp
+++ b/host/lib/usrp/common/apply_corrections.cpp
@@ -58,6 +58,7 @@ static std::complex<double> get_fe_dc_correction(
const std::string &key, const double lo_freq
){
const std::vector<fe_cal_t> &datas = fe_cal_cache[key];
+ if (datas.empty()) throw uhd::runtime_error("empty calibration table " + key);
//search for lo freq
size_t lo_index = 0;
@@ -84,6 +85,7 @@ static std::complex<double> get_fe_iq_correction(
const std::string &key, const double lo_freq
){
const std::vector<fe_cal_t> &datas = fe_cal_cache[key];
+ if (datas.empty()) throw uhd::runtime_error("empty calibration table " + key);
//search for lo freq
size_t lo_index = 0;
@@ -153,11 +155,11 @@ static void apply_fe_corrections(
}
- if (file_prefix.find("dc") != std::string::npos){
+ if (file_prefix.find("dc_cal") != std::string::npos){
sub_tree->access<std::complex<double> >(fe_path)
.set(get_fe_dc_correction(cal_data_path.string(), lo_freq));
}
- else if (file_prefix.find("iq") != std::string::npos){
+ else if (file_prefix.find("iq_cal") != std::string::npos){
sub_tree->access<std::complex<double> >(fe_path)
.set(get_fe_iq_correction(cal_data_path.string(), lo_freq));
}