aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-12-14 13:30:01 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-12-14 13:30:07 +0100
commit03b11620d9314465f8482ff234b78441496111a0 (patch)
treeac05d7a02914eaef9bc69e8e84d362b77492290f /Transceiver52M
parent25185886f015201c97956ca9f400aa2bdbbeec27 (diff)
lms: Fix build against LimeSuite > 18.10
LimeSuite dc124e4e2ed9b549b142410af172f0592f9f0c23 > 18.10 broke API compatibility. OS#3729 Change-Id: Idf500a5b39a857233f728c6a4316c00a99374556
Diffstat (limited to 'Transceiver52M')
-rw-r--r--Transceiver52M/device/lms/LMSDevice.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index 270bd4a..b004308 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -41,6 +41,24 @@ constexpr double LMSDevice::masterClockRate;
#define LMS_MIN_BW_SUPPORTED 2.5e6 /* 2.5mHz, minimum supported by LMS */
#define LMS_CALIBRATE_BW_HZ OSMO_MAX(GSM_CARRIER_BW, LMS_MIN_BW_SUPPORTED)
+static int compat_LMS_VCTCXORead(lms_device_t *dev, uint16_t *val, bool memory)
+{
+#if HAVE_LMS_VCTCXO_EEPROM_SAVING
+ return LMS_VCTCXORead(dev, val, memory);
+#else
+ return LMS_VCTCXORead(dev, val);
+#endif
+}
+
+static int compat_LMS_VCTCXOWrite(lms_device_t *dev, uint16_t val, bool memory)
+{
+#if HAVE_LMS_VCTCXO_EEPROM_SAVING
+ return LMS_VCTCXOWrite(dev, val, memory);
+#else
+ return LMS_VCTCXOWrite(dev, val);
+#endif
+}
+
LMSDevice::LMSDevice(size_t tx_sps, size_t rx_sps, InterfaceType iface, size_t chans, double lo_offset,
const std::vector<std::string>& tx_paths,
const std::vector<std::string>& rx_paths):
@@ -195,10 +213,10 @@ int LMSDevice::open(const std::string &args, int ref, bool swap_channels)
case REF_INTERNAL:
LOGC(DDEV, INFO) << "Setting Internal clock reference";
/* Ugly API: Selecting clock source implicit by writing to VCTCXO DAC ?!? */
- if (LMS_VCTCXORead(m_lms_dev, &dac_val) < 0)
+ if (compat_LMS_VCTCXORead(m_lms_dev, &dac_val, false) < 0)
goto out_close;
LOGC(DDEV, INFO) << "Setting VCTCXO to " << dac_val;
- if (LMS_VCTCXOWrite(m_lms_dev, dac_val) < 0)
+ if (compat_LMS_VCTCXOWrite(m_lms_dev, dac_val, false) < 0)
goto out_close;
break;
case REF_EXTERNAL: