mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-23 16:34:43 +01:00
windows debug build
This commit is contained in:
parent
bb9024fadd
commit
936c99dc40
4
.github/workflows/build_all.yml
vendored
4
.github/workflows/build_all.yml
vendored
@ -68,11 +68,11 @@ jobs:
|
||||
|
||||
- name: Prepare CMake
|
||||
working-directory: ${{runner.workspace}}/build
|
||||
run: cmake "$Env:GITHUB_WORKSPACE" "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_PERSEUS_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON
|
||||
run: cmake "$Env:GITHUB_WORKSPACE" "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DCMAKE_BUILD_TYPE=Debug -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_PERSEUS_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{runner.workspace}}/build
|
||||
run: cmake --build . --config Release --verbose
|
||||
run: cmake --build . --config Debug --verbose
|
||||
|
||||
- name: Create Archive
|
||||
working-directory: ${{runner.workspace}}
|
||||
|
@ -52,4 +52,15 @@ namespace ImGui {
|
||||
bufferMtx.unlock();
|
||||
}
|
||||
|
||||
void SymbolDiagram::setCount(int count) {
|
||||
std::lock_guard<std::mutex> lck(bufferMtx);
|
||||
delete[] buffer;
|
||||
buffer = new float[count];
|
||||
sampleCount = count;
|
||||
memset(buffer, 0, sampleCount * sizeof(float));
|
||||
}
|
||||
|
||||
int SymbolDiagram::getCount() {
|
||||
return sampleCount;
|
||||
}
|
||||
}
|
@ -18,6 +18,10 @@ namespace ImGui {
|
||||
|
||||
void releaseBuffer();
|
||||
|
||||
void setCount(int count);
|
||||
|
||||
int getCount();
|
||||
|
||||
std::vector<float> lines;
|
||||
|
||||
private:
|
||||
|
@ -8,15 +8,15 @@
|
||||
#include "dsp.h"
|
||||
#include "pocsag.h"
|
||||
|
||||
#define BAUDRATE 2400
|
||||
#define SAMPLERATE (BAUDRATE*10)
|
||||
|
||||
class POCSAGDecoder : public Decoder {
|
||||
public:
|
||||
POCSAGDecoder(const std::string& name, VFOManager::VFO* vfo) : diag(0.6, BAUDRATE) {
|
||||
POCSAGDecoder(const std::string& name, VFOManager::VFO* vfo) : diag(0.6, 2400) {
|
||||
this->name = name;
|
||||
this->vfo = vfo;
|
||||
|
||||
// Default baudrate (TODO: Load from config)
|
||||
baudrate = 2400;
|
||||
|
||||
// Define baudrate options
|
||||
baudrates.define(512, "512 Baud", 512);
|
||||
baudrates.define(1200, "1200 Baud", 1200);
|
||||
@ -24,9 +24,9 @@ public:
|
||||
|
||||
// Init DSP
|
||||
vfo->setBandwidthLimits(12500, 12500, true);
|
||||
vfo->setSampleRate(SAMPLERATE, 12500);
|
||||
dsp.init(vfo->output, SAMPLERATE, BAUDRATE);
|
||||
reshape.init(&dsp.soft, BAUDRATE, (BAUDRATE / 30.0) - BAUDRATE);
|
||||
vfo->setSampleRate(baudrate*10.0, 12500);
|
||||
dsp.init(vfo->output, baudrate*10.0, baudrate);
|
||||
reshape.init(&dsp.soft, baudrate, (baudrate / 30.0) - baudrate);
|
||||
dataHandler.init(&dsp.out, _dataHandler, this);
|
||||
diagHandler.init(&reshape.out, _diagHandler, this);
|
||||
|
||||
@ -42,7 +42,7 @@ public:
|
||||
ImGui::LeftLabel("Baudrate");
|
||||
ImGui::FillWidth();
|
||||
if (ImGui::Combo(("##pager_decoder_pocsag_br_" + name).c_str(), &brId, baudrates.txt)) {
|
||||
// TODO
|
||||
setBaudrate(baudrates.value(brId));
|
||||
}
|
||||
|
||||
ImGui::FillWidth();
|
||||
@ -79,7 +79,8 @@ private:
|
||||
static void _diagHandler(float* data, int count, void* ctx) {
|
||||
POCSAGDecoder* _this = (POCSAGDecoder*)ctx;
|
||||
float* buf = _this->diag.acquireBuffer();
|
||||
memcpy(buf, data, count * sizeof(float));
|
||||
int maxCount = std::min<int>(count, _this->diag.getCount());
|
||||
memcpy(buf, data, maxCount * sizeof(float));
|
||||
_this->diag.releaseBuffer();
|
||||
}
|
||||
|
||||
@ -87,6 +88,15 @@ private:
|
||||
flog::debug("[{}]: '{}'", (uint32_t)addr, msg);
|
||||
}
|
||||
|
||||
void setBaudrate(double baudrate) {
|
||||
vfo->setSampleRate(baudrate*10.0, 12500);
|
||||
stop();
|
||||
reshape.setKeep(baudrate);
|
||||
reshape.setSkip((baudrate / 30.0) - baudrate);
|
||||
diag.setCount(baudrate);
|
||||
start();
|
||||
}
|
||||
|
||||
std::string name;
|
||||
VFOManager::VFO* vfo;
|
||||
|
||||
@ -100,6 +110,7 @@ private:
|
||||
ImGui::SymbolDiagram diag;
|
||||
|
||||
int brId = 2;
|
||||
double baudrate = 2400;
|
||||
|
||||
OptionList<int, int> baudrates;
|
||||
};
|
@ -71,4 +71,4 @@ make VERBOSE=1 -j2
|
||||
|
||||
# Generate package
|
||||
cd ..
|
||||
sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libvolk1-dev, librtaudio-dev, libzstd-dev'
|
||||
sh make_debian_package.sh ./build 'libfftw3-bin, libglfw3, libvolk1-bin, librtaudio6, libzstd1'
|
@ -32,4 +32,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD
|
||||
make VERBOSE=1 -j2
|
||||
|
||||
cd ..
|
||||
sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libvolk2-dev, librtaudio-dev, libzstd-dev'
|
||||
sh make_debian_package.sh ./build 'libfftw3-bin, libglfw3, libvolk2-bin, librtaudio6, libzstd1'
|
@ -32,4 +32,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD
|
||||
make VERBOSE=1 -j2
|
||||
|
||||
cd ..
|
||||
sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libvolk2-dev, librtaudio-dev, libzstd-dev'
|
||||
sh make_debian_package.sh ./build 'libfftw3-bin, libglfw3, libvolk2-bin, librtaudio6, libzstd1'
|
@ -32,4 +32,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD
|
||||
make VERBOSE=1 -j2
|
||||
|
||||
cd ..
|
||||
sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libvolk-dev, librtaudio-dev, libzstd-dev'
|
||||
sh make_debian_package.sh ./build 'libfftw3-bin, libglfw3, libvolk-bin, librtaudio6, libzstd1'
|
@ -32,4 +32,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD
|
||||
make VERBOSE=1 -j2
|
||||
|
||||
cd ..
|
||||
sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libvolk-dev, librtaudio-dev, libzstd-dev'
|
||||
sh make_debian_package.sh ./build 'libfftw3-bin, libglfw3, libvolk-bin, librtaudio6, libzstd1'
|
@ -61,7 +61,8 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void refresh() {
|
||||
void refresh() {
|
||||
#ifndef __ANDROID__
|
||||
devices.clear();
|
||||
auto list = librfnm::find(librfnm_transport::LIBRFNM_TRANSPORT_USB);
|
||||
for (const auto& info : list) {
|
||||
@ -75,6 +76,16 @@ private:
|
||||
// Save device
|
||||
devices.define((char*)info.motherboard.serial_number, devName, (char*)info.motherboard.serial_number);
|
||||
}
|
||||
#else
|
||||
// Check for device presence
|
||||
int vid, pid;
|
||||
devFd = backend::getDeviceFD(vid, pid, backend::RFNM_VIDPIDS);
|
||||
if (devFd < 0) { return; }
|
||||
|
||||
// Get device info
|
||||
std::string fakeName = "RFNM USB";
|
||||
devices.define(fakeName, fakeName, fakeName);
|
||||
#endif
|
||||
}
|
||||
|
||||
void select(const std::string& serial) {
|
||||
@ -142,7 +153,11 @@ private:
|
||||
if (_this->running) { return; }
|
||||
|
||||
// Open the device
|
||||
#ifndef __ANDROID__
|
||||
_this->openDev = new librfnm(librfnm_transport::LIBRFNM_TRANSPORT_USB, _this->selectedSerial);
|
||||
#else
|
||||
_this->openDev = new librfnm(_this->devFd);
|
||||
#endif
|
||||
|
||||
// Configure the device
|
||||
_this->openDev->librfnm_s->rx.ch[0].enable = RFNM_CH_ON;
|
||||
@ -323,6 +338,10 @@ private:
|
||||
int bufferSize = -1;
|
||||
librfnm_rx_buf rxBuf[LIBRFNM_MIN_RX_BUFCNT];
|
||||
|
||||
#ifdef __ANDROID__
|
||||
int devFd = 0;
|
||||
#endif
|
||||
|
||||
std::thread workerThread;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user