diff options
author | Ashish Chaudhari <ashish@ettus.com> | 2015-02-11 16:33:58 -0800 |
---|---|---|
committer | Ashish Chaudhari <ashish@ettus.com> | 2015-02-11 16:33:58 -0800 |
commit | ec7eedcca8418970e081b4875c2d5c147611025b (patch) | |
tree | 6de14c745f93342fd4717c191a62a0478ab9a919 | |
parent | ac958d47e8c7c4e0ee6a010d3e5a592d392e9206 (diff) | |
parent | 08267a8c0264e08fe6631ce2ede0ec2c2933463f (diff) | |
download | uhd-ec7eedcca8418970e081b4875c2d5c147611025b.tar.gz uhd-ec7eedcca8418970e081b4875c2d5c147611025b.tar.bz2 uhd-ec7eedcca8418970e081b4875c2d5c147611025b.zip |
Merge branch 'bhilburn/uhdcalibpath' into maint
-rw-r--r-- | host/docs/calibration.dox | 18 | ||||
-rw-r--r-- | host/lib/utils/paths.cpp | 11 |
2 files changed, 20 insertions, 9 deletions
diff --git a/host/docs/calibration.dox b/host/docs/calibration.dox index 603ae22e4..eecb7af5c 100644 --- a/host/docs/calibration.dox +++ b/host/docs/calibration.dox @@ -57,15 +57,23 @@ daughterboard's EEPROM: : \subsection calibration_data Calibration Data -Calibration files are stored in the user's home/application directory. -They can easily be moved from machine to another by copying the "cal" -directory. Re-running a calibration utility will replace the existing -calibration file. The old calibration file will be renamed so it may be -recovered by the user. +By default, calibration files are stored in the user's home/application +directory: - **Linux:** `${HOME}/.uhd/cal/` - **Windows:** `%APPDATA%\.uhd\cal\` +If you would like to specify a custom directory, you can do so with the +`$UHD_CONFIG_DIR` environment variable: + +- **Custom (any OS):** `${UHD_CONFIG_DIR}/.uhd/cal/` + +Calibration files can easily be moved from one machine to another by copying the +"cal" directory. Re-running a calibration utility will replace the existing +calibration file. The old calibration file will be renamed so it may be +recovered by the user. + + \subsection ignore_cal_file Ignoring Calibration Files At runtime, the user can choose to ignore a daughterboard's calibration file by adding "ignore-cal-file" to the arguments. With the UHD API, it can be done as follows: diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp index 4a95431b8..f29318ddd 100644 --- a/host/lib/utils/paths.cpp +++ b/host/lib/utils/paths.cpp @@ -173,11 +173,14 @@ std::string uhd::get_tmp_path(void){ } std::string uhd::get_app_path(void){ - const char *appdata_path = std::getenv("APPDATA"); - if (appdata_path != NULL) return appdata_path; + const std::string uhdcalib_path = get_env_var("UHD_CONFIG_DIR"); + if (not uhdcalib_path.empty()) return uhdcalib_path; - const char *home_path = std::getenv("HOME"); - if (home_path != NULL) return home_path; + const std::string appdata_path = get_env_var("APPDATA"); + if (not appdata_path.empty()) return appdata_path; + + const std::string home_path = get_env_var("HOME"); + if (not home_path.empty()) return home_path; return uhd::get_tmp_path(); } |