aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-01-14 17:54:29 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2020-01-15 15:35:01 +0100
commite7f6a27ab6bb3f59d517c2be89793204b9eda0c2 (patch)
treeda1849905aef0c59d68c43e792afc226c0ed655e
parenta979f5f32bd2da9b7ab3db5292807696c803bf9a (diff)
lms: Move rx_buffers allocation to constructor
Release is done in destructor, so let's move allocation to constructor since there's really no need to have them in open() which is already quite complex and large. Change-Id: I8a4fd973590c4c165abd8f2837b2da8fc14a2066
-rw-r--r--Transceiver52M/device/lms/LMSDevice.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index 3d2b68e..8ad338b 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -58,6 +58,11 @@ LMSDevice::LMSDevice(size_t tx_sps, size_t rx_sps, InterfaceType iface, size_t c
tx_gains.resize(chans);
rx_buffers.resize(chans);
+
+ /* Set up per-channel Rx timestamp based Ring buffers */
+ for (size_t i = 0; i < rx_buffers.size(); i++)
+ rx_buffers[i] = new smpl_buf(SAMPLE_BUF_SZ / sizeof(uint32_t));
+
}
LMSDevice::~LMSDevice()
@@ -243,10 +248,6 @@ int LMSDevice::open(const std::string &args, int ref, bool swap_channels)
goto out_close;
}
- /* Set up per-channel Rx timestamp based Ring buffers */
- for (size_t i = 0; i < rx_buffers.size(); i++)
- rx_buffers[i] = new smpl_buf(SAMPLE_BUF_SZ / sizeof(uint32_t));
-
return NORMAL;
out_close: