aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/nirio
diff options
context:
space:
mode:
authorNicholas Corgan <nick.corgan@ettus.com>2014-03-27 06:37:33 -0700
committerNicholas Corgan <nick.corgan@ettus.com>2014-04-08 14:07:27 -0700
commit0df60b7c92a84dcaf73cc22bcc488a8f3047f549 (patch)
tree12d2bea5de5f871ed0a7b580256ad72525b34697 /host/lib/transport/nirio
parentb6f125388bb7bda1a8afd591b193a04a54252889 (diff)
downloaduhd-0df60b7c92a84dcaf73cc22bcc488a8f3047f549.tar.gz
uhd-0df60b7c92a84dcaf73cc22bcc488a8f3047f549.tar.bz2
uhd-0df60b7c92a84dcaf73cc22bcc488a8f3047f549.zip
x300: add UHD_IMAGES_DIR to list of directories searched for LVBITX files
Diffstat (limited to 'host/lib/transport/nirio')
-rw-r--r--host/lib/transport/nirio/nifpga_lvbitx.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/host/lib/transport/nirio/nifpga_lvbitx.cpp b/host/lib/transport/nirio/nifpga_lvbitx.cpp
index 289a44d4a..b87d87a8d 100644
--- a/host/lib/transport/nirio/nifpga_lvbitx.cpp
+++ b/host/lib/transport/nirio/nifpga_lvbitx.cpp
@@ -16,6 +16,7 @@
//
#include <uhd/transport/nirio/nifpga_lvbitx.h>
+#include <cstdlib>
#include <string>
#include <iostream>
#include <fstream>
@@ -109,6 +110,21 @@ std::string nifpga_lvbitx::_get_fpga_images_dir(const std::string search_paths)
std::vector<std::string> search_path_vtr;
boost::split(search_path_vtr, search_paths, boost::is_any_of(","));
+ //
+ // Add the value of the UHD_IMAGES_DIR environment variable to the list of
+ // directories searched for a LVBITX image.
+ //
+ char* uhd_images_dir;
+#ifdef UHD_PLATFORM_WIN32
+ size_t len;
+ errno_t err = _dupenv_s(&uhd_images_dir, &len, "UHD_IMAGES_DIR");
+ if(not err and uhd_images_dir != NULL) search_path_vtr.push_back(std::string(uhd_images_dir));
+ free(uhd_images_dir);
+#else
+ uhd_images_dir = getenv("UHD_IMAGES_DIR");
+ if(uhd_images_dir != NULL) search_path_vtr.push_back(std::string(uhd_images_dir));
+#endif
+
std::string lvbitx_dir;
//Traverse through the list of search paths. Priority: lexical
BOOST_FOREACH(std::string& search_path, search_path_vtr) {