diff options
author | Ben Hilburn <ben.hilburn@ettus.com> | 2014-05-21 11:56:07 -0700 |
---|---|---|
committer | Ben Hilburn <ben.hilburn@ettus.com> | 2014-05-21 11:56:07 -0700 |
commit | f2fbcfa30edd32e134a23a1e18079f3e354709f1 (patch) | |
tree | 138a997cd1ebc44eb95f04a2f1716487dad52b98 /host/examples | |
parent | 054a752bb25f9e17c1269b28ad2a95865c0d63a2 (diff) | |
download | uhd-f2fbcfa30edd32e134a23a1e18079f3e354709f1.tar.gz uhd-f2fbcfa30edd32e134a23a1e18079f3e354709f1.tar.bz2 uhd-f2fbcfa30edd32e134a23a1e18079f3e354709f1.zip |
Lots of bit-specific type work to fix compilation on older OSes.
Diffstat (limited to 'host/examples')
-rw-r--r-- | host/examples/fpgpio.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/host/examples/fpgpio.cpp b/host/examples/fpgpio.cpp index 89a6ecec3..151d5645d 100644 --- a/host/examples/fpgpio.cpp +++ b/host/examples/fpgpio.cpp @@ -37,6 +37,7 @@ #include <uhd/convert.hpp> #include <boost/program_options.hpp> #include <boost/format.hpp> +#include <boost/cstdint.hpp> #include <boost/thread.hpp> #include <csignal> #include <iostream> @@ -72,14 +73,14 @@ void output_reg_values(const std::string bank, const uhd::usrp::multi_usrp::sptr for (int i = FPGPIO_NUM_BITS - 1; i >= 0; i--) std::cout << (boost::format(" %s%d") % (i < 10 ? " " : "") % i); std::cout << std::endl; - std::cout << "CTRL: " << to_bit_string(uint16_t(usrp->get_gpio_attr(bank, std::string("CTRL")))) << std::endl; - std::cout << "DDR: " << to_bit_string(uint16_t(usrp->get_gpio_attr(bank, std::string("DDR")))) << std::endl; - std::cout << "ATR_0X: " << to_bit_string(uint16_t(usrp->get_gpio_attr(bank, std::string("ATR_0X")))) << std::endl; - std::cout << "ATR_RX: " << to_bit_string(uint16_t(usrp->get_gpio_attr(bank, std::string("ATR_RX")))) << std::endl; - std::cout << "ATR_TX: " << to_bit_string(uint16_t(usrp->get_gpio_attr(bank, std::string("ATR_TX")))) << std::endl; - std::cout << "ATR_XX: " << to_bit_string(uint16_t(usrp->get_gpio_attr(bank, std::string("ATR_XX")))) << std::endl; - std::cout << "OUT: " << to_bit_string(uint16_t(usrp->get_gpio_attr(bank, std::string("OUT")))) << std::endl; - std::cout << "READBACK: " << to_bit_string(uint16_t(usrp->get_gpio_attr(bank, std::string("READBACK")))) << std::endl; + std::cout << "CTRL: " << to_bit_string(boost::uint16_t(usrp->get_gpio_attr(bank, std::string("CTRL")))) << std::endl; + std::cout << "DDR: " << to_bit_string(boost::uint16_t(usrp->get_gpio_attr(bank, std::string("DDR")))) << std::endl; + std::cout << "ATR_0X: " << to_bit_string(boost::uint16_t(usrp->get_gpio_attr(bank, std::string("ATR_0X")))) << std::endl; + std::cout << "ATR_RX: " << to_bit_string(boost::uint16_t(usrp->get_gpio_attr(bank, std::string("ATR_RX")))) << std::endl; + std::cout << "ATR_TX: " << to_bit_string(boost::uint16_t(usrp->get_gpio_attr(bank, std::string("ATR_TX")))) << std::endl; + std::cout << "ATR_XX: " << to_bit_string(boost::uint16_t(usrp->get_gpio_attr(bank, std::string("ATR_XX")))) << std::endl; + std::cout << "OUT: " << to_bit_string(boost::uint16_t(usrp->get_gpio_attr(bank, std::string("OUT")))) << std::endl; + std::cout << "READBACK: " << to_bit_string(boost::uint16_t(usrp->get_gpio_attr(bank, std::string("READBACK")))) << std::endl; } int UHD_SAFE_MAIN(int argc, char *argv[]){ @@ -124,13 +125,13 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ output_reg_values(fpgpio, usrp); //configure GPIO registers - uint32_t ctrl = 0; // default all as manual - uint32_t ddr = 0; // default all as input - uint32_t atr_idle = 0; - uint32_t atr_rx = 0; - uint32_t atr_tx = 0; - uint32_t atr_duplex = 0; - uint32_t mask = 0x7ff; + boost::uint32_t ctrl = 0; // default all as manual + boost::uint32_t ddr = 0; // default all as input + boost::uint32_t atr_idle = 0; + boost::uint32_t atr_rx = 0; + boost::uint32_t atr_tx = 0; + boost::uint32_t atr_duplex = 0; + boost::uint32_t mask = 0x7ff; //set up FPGPIO outputs: //FPGPIO[0] = ATR output 1 at idle |