aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Tsou <tom.tsou@ettus.com>2017-03-07 14:16:46 -0800
committerTom Tsou <tom.tsou@ettus.com>2017-03-07 14:25:05 -0800
commit72bf762b42571998e353c298691d74d7ce897bdc (patch)
tree7b3a73b7d742f512ed998cae4c9b4450b9c03d9d
parent2dee3e996e777b67aa3185f7456c041765f0d71f (diff)
uhd: Add support for UHD-3.11 logging control
The logging API changes in UHD-3.11, which causes build failure if not properly handled. Change-Id: I223ebb9fae3f4061e0cb37c05263c1b569e8f628
-rw-r--r--Transceiver52M/UHDDevice.cpp14
-rw-r--r--configure.ac9
2 files changed, 16 insertions, 7 deletions
diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp
index d139cdc..35eb827 100644
--- a/Transceiver52M/UHDDevice.cpp
+++ b/Transceiver52M/UHDDevice.cpp
@@ -28,12 +28,15 @@
#include <uhd/property_tree.hpp>
#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/utils/thread_priority.hpp>
-#include <uhd/utils/msg.hpp>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#ifndef USE_UHD_3_11
+#include <uhd/utils/msg.hpp>
+#endif
+
#define B2XX_CLK_RT 26e6
#define B2XX_MCBTS_CLK_RT 3.2e6
#define E1XX_CLK_RT 52e6
@@ -84,7 +87,7 @@ struct uhd_dev_offset {
/*
* USRP version dependent device timings
*/
-#ifdef USE_UHD_3_9
+#if defined(USE_UHD_3_9) || defined(USE_UHD_3_11)
#define B2XX_TIMING_1SPS 1.7153e-4
#define B2XX_TIMING_4SPS 1.1696e-4
#define B2XX_TIMING_4_4SPS 6.18462e-5
@@ -383,7 +386,8 @@ void *async_event_loop(uhd_device *dev)
return NULL;
}
-/*
+#ifndef USE_UHD_3_11
+/*
Catch and drop underrun 'U' and overrun 'O' messages from stdout
since we already report using the logging facility. Direct
everything else appropriately.
@@ -404,6 +408,7 @@ void uhd_msg_handler(uhd::msg::type_t type, const std::string &msg)
break;
}
}
+#endif
static void thread_enable_cancel(bool cancel)
{
@@ -995,9 +1000,10 @@ bool uhd_device::start()
return false;
}
+#ifndef USE_UHD_3_11
// Register msg handler
uhd::msg::register_handler(&uhd_msg_handler);
-
+#endif
// Start asynchronous event (underrun check) loop
async_event_thrd = new Thread();
async_event_thrd->start((void * (*)(void*))async_event_loop, (void*)this);
diff --git a/configure.ac b/configure.ac
index 649bb0e..f1159c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,9 +97,12 @@ AS_IF([test "x$with_usrp1" = "xyes"], [
])
AS_IF([test "x$with_usrp1" != "xyes"],[
- PKG_CHECK_MODULES(UHD, uhd >= 003.009,
- [AC_DEFINE(USE_UHD_3_9, 1, UHD version 3.9.0 or higher)],
- [PKG_CHECK_MODULES(UHD, uhd >= 003.005.004)]
+ PKG_CHECK_MODULES(UHD, uhd >= 003.011,
+ [AC_DEFINE(USE_UHD_3_11, 1, UHD version 3.11.0 or higher)],
+ [PKG_CHECK_MODULES(UHD, uhd >= 003.009,
+ [AC_DEFINE(USE_UHD_3_9, 1, UHD version 3.9.0 or higher)],
+ [PKG_CHECK_MODULES(UHD, uhd >= 003.005)]
+ )]
)
AC_DEFINE(USE_UHD, 1, All UHD versions)
PKG_CHECK_MODULES(FFTWF, fftw3f)