mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 09:48:45 -05:00
Fixed some MSVC compatibility issues
This commit is contained in:
parent
147bf5c24e
commit
5649162d9e
@ -17,14 +17,6 @@
|
|||||||
|
|
||||||
#include "filesource.h"
|
#include "filesource.h"
|
||||||
|
|
||||||
#if (defined _WIN32_) || (defined _MSC_VER)
|
|
||||||
#include "windows_time.h"
|
|
||||||
#include <stdint.h>
|
|
||||||
#else
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QNetworkAccessManager>
|
#include <QNetworkAccessManager>
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
|
@ -341,9 +341,14 @@ bool Bladerf1Output::applySettings(const BladeRF1OutputSettings& settings, bool
|
|||||||
|
|
||||||
if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || (m_settings.m_log2Interp != settings.m_log2Interp) || force)
|
if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || (m_settings.m_log2Interp != settings.m_log2Interp) || force)
|
||||||
{
|
{
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
unsigned int fifoRate = (unsigned int) settings.m_devSampleRate / (1<<settings.m_log2Interp);
|
||||||
|
fifoRate = fifoRate < 48000U ? 48000U : fifoRate;
|
||||||
|
#else
|
||||||
unsigned int fifoRate = std::max(
|
unsigned int fifoRate = std::max(
|
||||||
(unsigned int) settings.m_devSampleRate / (1<<settings.m_log2Interp),
|
(unsigned int) settings.m_devSampleRate / (1<<settings.m_log2Interp),
|
||||||
DeviceBladeRF1Shared::m_sampleFifoMinRate);
|
DeviceBladeRF1Shared::m_sampleFifoMinRate);
|
||||||
|
#endif
|
||||||
m_sampleSourceFifo.resize(SampleSourceFifo::getSizePolicy(fifoRate));
|
m_sampleSourceFifo.resize(SampleSourceFifo::getSizePolicy(fifoRate));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -722,9 +722,14 @@ bool BladeRF2Output::applySettings(const BladeRF2OutputSettings& settings, bool
|
|||||||
bladeRF2OutputThread->setFifo(requestedChannel, 0);
|
bladeRF2OutputThread->setFifo(requestedChannel, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
unsigned int fifoRate = (unsigned int) settings.m_devSampleRate / (1<<settings.m_log2Interp);
|
||||||
|
fifoRate = fifoRate < 48000U ? 48000U : fifoRate;
|
||||||
|
#else
|
||||||
unsigned int fifoRate = std::max(
|
unsigned int fifoRate = std::max(
|
||||||
(unsigned int) settings.m_devSampleRate / (1<<settings.m_log2Interp),
|
(unsigned int) settings.m_devSampleRate / (1<<settings.m_log2Interp),
|
||||||
DeviceBladeRF2Shared::m_sampleFifoMinRate);
|
DeviceBladeRF2Shared::m_sampleFifoMinRate);
|
||||||
|
#endif
|
||||||
m_sampleSourceFifo.resize(SampleSourceFifo::getSizePolicy(fifoRate));
|
m_sampleSourceFifo.resize(SampleSourceFifo::getSizePolicy(fifoRate));
|
||||||
|
|
||||||
if (fifo) {
|
if (fifo) {
|
||||||
|
@ -823,9 +823,14 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
|
|||||||
reverseAPIKeys.append("devSampleRate");
|
reverseAPIKeys.append("devSampleRate");
|
||||||
reverseAPIKeys.append("log2SoftInterp");
|
reverseAPIKeys.append("log2SoftInterp");
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
unsigned int fifoRate = (unsigned int) settings.m_devSampleRate / (1<<settings.m_log2SoftInterp);
|
||||||
|
fifoRate = fifoRate < 48000U ? 48000U : fifoRate;
|
||||||
|
#else
|
||||||
unsigned int fifoRate = std::max(
|
unsigned int fifoRate = std::max(
|
||||||
(unsigned int) settings.m_devSampleRate / (1<<settings.m_log2SoftInterp),
|
(unsigned int) settings.m_devSampleRate / (1<<settings.m_log2SoftInterp),
|
||||||
DeviceLimeSDRShared::m_sampleFifoMinRate);
|
DeviceLimeSDRShared::m_sampleFifoMinRate);
|
||||||
|
#endif
|
||||||
m_sampleSourceFifo.resize(SampleSourceFifo::getSizePolicy(fifoRate));
|
m_sampleSourceFifo.resize(SampleSourceFifo::getSizePolicy(fifoRate));
|
||||||
qDebug("LimeSDROutput::applySettings: resize FIFO: rate %u", fifoRate);
|
qDebug("LimeSDROutput::applySettings: resize FIFO: rate %u", fifoRate);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user