Change in osmo-trx[master]: lms: Fix build against LimeSuite > 18.10

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Fri Dec 14 12:33:30 UTC 2018


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/12303


Change subject: lms: Fix build against LimeSuite > 18.10
......................................................................

lms: Fix build against LimeSuite > 18.10

LimeSuite dc124e4e2ed9b549b142410af172f0592f9f0c23 > 18.10 broke API
compatibility.

OS#3729
Change-Id: Idf500a5b39a857233f728c6a4316c00a99374556
---
M Transceiver52M/device/lms/LMSDevice.cpp
M configure.ac
2 files changed, 34 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/03/12303/1

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 @@
 #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 @@
 	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:
diff --git a/configure.ac b/configure.ac
index 2e036ba..37b70fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -160,6 +160,20 @@
 
 AS_IF([test "x$with_lms" = "xyes"], [
     PKG_CHECK_MODULES(LMS, LimeSuite)
+
+    # LimeSuite dc124e4e2ed9b549b142410af172f0592f9f0c23 > 18.10 broke API compatibility:
+    _cflags_save=$CFLAGS
+    CFLAGS="$CFLAGS $LMS_CFLAGS"
+    AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM(
+            [[#include <lime/LimeSuite.h>]],
+            [[LMS_VCTCXOWrite(NULL, 0, false); LMS_VCTCXORead(NULL, 0, false);]]
+        )],
+        [AC_DEFINE([HAVE_LMS_VCTCXO_EEPROM_SAVING], [1],
+            [LMS_VCTCXO* requires memory parameter])],
+        [AC_DEFINE([HAVE_LMS_VCTCXO_EEPROM_SAVING], [0],
+            [LMS_VCTCXO* has no memory parameter])])
+    CFLAGS=$_cflags_save
 ])
 
 AS_IF([test "x$with_uhd" != "xno"],[

-- 
To view, visit https://gerrit.osmocom.org/12303
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf500a5b39a857233f728c6a4316c00a99374556
Gerrit-Change-Number: 12303
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181214/6e22f7a6/attachment.htm>


More information about the gerrit-log mailing list