mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-09-05 06:37:52 -04:00
MSVC fix-up
This commit is contained in:
parent
b75586119c
commit
b413c8454b
@ -8,6 +8,10 @@
|
|||||||
|
|
||||||
#define MIN_BANDWIDTH 500
|
#define MIN_BANDWIDTH 500
|
||||||
|
|
||||||
|
#ifndef M_PI
|
||||||
|
#define M_PI 3.14159265358979323846
|
||||||
|
#endif
|
||||||
|
|
||||||
class ModemKit {
|
class ModemKit {
|
||||||
public:
|
public:
|
||||||
ModemKit() : sampleRate(0), audioSampleRate(0) {
|
ModemKit() : sampleRate(0), audioSampleRate(0) {
|
||||||
|
@ -11,11 +11,12 @@ ModemLSB::ModemLSB() : ModemAnalog() {
|
|||||||
|
|
||||||
// estimate required filter length and generate filter
|
// estimate required filter length and generate filter
|
||||||
unsigned int h_len = estimate_req_filter_len(ft,As);
|
unsigned int h_len = estimate_req_filter_len(ft,As);
|
||||||
float h[h_len];
|
float *h = (float *) malloc(h_len * sizeof(float));
|
||||||
liquid_firdes_kaiser(h_len,fc,As,mu,h);
|
liquid_firdes_kaiser(h_len,fc,As,mu,h);
|
||||||
ssbFilt = firfilt_crcf_create(h,h_len);
|
ssbFilt = firfilt_crcf_create(h,h_len);
|
||||||
ssbShift = nco_crcf_create(LIQUID_NCO);
|
ssbShift = nco_crcf_create(LIQUID_NCO);
|
||||||
nco_crcf_set_frequency(ssbShift, (2.0 * M_PI) * 0.25);
|
nco_crcf_set_frequency(ssbShift, (2.0 * M_PI) * 0.25);
|
||||||
|
free(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
Modem *ModemLSB::factory() {
|
Modem *ModemLSB::factory() {
|
||||||
|
@ -11,11 +11,12 @@ ModemUSB::ModemUSB() : ModemAnalog() {
|
|||||||
|
|
||||||
// estimate required filter length and generate filter
|
// estimate required filter length and generate filter
|
||||||
unsigned int h_len = estimate_req_filter_len(ft,As);
|
unsigned int h_len = estimate_req_filter_len(ft,As);
|
||||||
float h[h_len];
|
float *h = (float *) malloc(h_len * sizeof(float));
|
||||||
liquid_firdes_kaiser(h_len,fc,As,mu,h);
|
liquid_firdes_kaiser(h_len,fc,As,mu,h);
|
||||||
ssbFilt = firfilt_crcf_create(h,h_len);
|
ssbFilt = firfilt_crcf_create(h,h_len);
|
||||||
ssbShift = nco_crcf_create(LIQUID_NCO);
|
ssbShift = nco_crcf_create(LIQUID_NCO);
|
||||||
nco_crcf_set_frequency(ssbShift, (2.0 * M_PI) * 0.25);
|
nco_crcf_set_frequency(ssbShift, (2.0 * M_PI) * 0.25);
|
||||||
|
free(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
Modem *ModemUSB::factory() {
|
Modem *ModemUSB::factory() {
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
#include "CubicSDR.h"
|
#include "CubicSDR.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <locale>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
std::vector<std::string> SDREnumerator::factories;
|
std::vector<std::string> SDREnumerator::factories;
|
||||||
std::vector<std::string> SDREnumerator::modules;
|
std::vector<std::string> SDREnumerator::modules;
|
||||||
@ -24,10 +28,18 @@ SDREnumerator::~SDREnumerator() {
|
|||||||
// Some utility from SoapySDR :)
|
// Some utility from SoapySDR :)
|
||||||
static std::string trim(const std::string &s)
|
static std::string trim(const std::string &s)
|
||||||
{
|
{
|
||||||
std::string out = s;
|
#if WIN32
|
||||||
|
std::string out = s;
|
||||||
|
locale loc("");
|
||||||
|
while (not out.empty() and std::isspace(out[0], loc)) out = out.substr(1);
|
||||||
|
while (not out.empty() and std::isspace(out[out.size() - 1], loc)) out = out.substr(0, out.size() - 1);
|
||||||
|
return out;
|
||||||
|
#else
|
||||||
|
std::string out = s;
|
||||||
while (not out.empty() and std::isspace(out[0])) out = out.substr(1);
|
while (not out.empty() and std::isspace(out[0])) out = out.substr(1);
|
||||||
while (not out.empty() and std::isspace(out[out.size()-1])) out = out.substr(0, out.size()-1);
|
while (not out.empty() and std::isspace(out[out.size()-1])) out = out.substr(0, out.size()-1);
|
||||||
return out;
|
return out;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
SoapySDR::Kwargs SDREnumerator::argsStrToKwargs(const std::string &args)
|
SoapySDR::Kwargs SDREnumerator::argsStrToKwargs(const std::string &args)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user