diff options
Diffstat (limited to 'host/lib/usrp/usrp_e100/fpga_downloader.cpp')
-rw-r--r-- | host/lib/usrp/usrp_e100/fpga_downloader.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/host/lib/usrp/usrp_e100/fpga_downloader.cpp b/host/lib/usrp/usrp_e100/fpga_downloader.cpp index c0013fcbd..018a120d6 100644 --- a/host/lib/usrp/usrp_e100/fpga_downloader.cpp +++ b/host/lib/usrp/usrp_e100/fpga_downloader.cpp @@ -16,14 +16,21 @@ // #include <uhd/config.hpp> -#include <uhd/utils/assert.hpp> +#ifdef UHD_DLL_EXPORTS +#include <uhd/exception.hpp> +#else //special case when this file is externally included +#include <stdexcept> +namespace uhd{ + typedef std::runtime_error os_error; + typedef std::runtime_error io_error; +} +#endif #include <iostream> #include <sstream> #include <fstream> #include <string> #include <cstdlib> -#include <stdexcept> #include <fcntl.h> #include <sys/types.h> @@ -88,7 +95,7 @@ gpio::gpio(unsigned int gpio_num, gpio_direction pin_direction) std::fstream export_file; export_file.open("/sys/class/gpio/export", std::ios::out); - if (not export_file.is_open()) throw std::runtime_error( + if (not export_file.is_open()) throw uhd::os_error( "Failed to open gpio export file." ); @@ -212,7 +219,7 @@ static void send_file_to_fpga(const std::string &file_name, gpio &error, gpio &d std::ifstream bitstream; bitstream.open(file_name.c_str(), std::ios::binary); - if (!bitstream.is_open()) throw std::runtime_error( + if (!bitstream.is_open()) throw uhd::os_error( "Coult not open the file: " + file_name ); |