diff --git a/src/AppFrame.cpp b/src/AppFrame.cpp index 754dece..5e80e3a 100644 --- a/src/AppFrame.cpp +++ b/src/AppFrame.cpp @@ -14,6 +14,7 @@ #include "SDRThread.h" #include "DemodulatorThread.h" #include "AudioThread.h" +#include "CubicSDR.h" wxBEGIN_EVENT_TABLE(AppFrame, wxFrame) //EVT_MENU(wxID_NEW, AppFrame::OnNewWindow) @@ -53,7 +54,7 @@ AppFrame::AppFrame() : SetMenuBar(menuBar); CreateStatusBar(); - SetClientSize(1280, 400); + SetClientSize(1280, 600); Centre(); Show(); @@ -186,6 +187,7 @@ void AppFrame::OnAudioInput(wxThreadEvent& event) { void AppFrame::OnIdle(wxIdleEvent& event) { + wxGetApp().Yield(); event.Skip(); } diff --git a/src/AudioThread.cpp b/src/AudioThread.cpp index c20b481..66a5691 100644 --- a/src/AudioThread.cpp +++ b/src/AudioThread.cpp @@ -111,9 +111,10 @@ wxThread::ExitCode AudioThread::Entry() { break; } } + } else { + this->Yield(); + this->Sleep(1); } - - Sleep(1000); } std::cout << std::endl << "Audio Thread Done." << std::endl << std::endl; diff --git a/src/CubicSDRDefs.h b/src/CubicSDRDefs.h index 014245a..6f60220 100644 --- a/src/CubicSDRDefs.h +++ b/src/CubicSDRDefs.h @@ -1,6 +1,6 @@ #pragma once -#define BUF_SIZE (16 * 32 * 256) +#define BUF_SIZE (16 * 32 * 128) #define SRATE 2000000 #define FFT_SIZE 2048 diff --git a/src/DemodulatorThread.cpp b/src/DemodulatorThread.cpp index 917e0b5..a3944fd 100644 --- a/src/DemodulatorThread.cpp +++ b/src/DemodulatorThread.cpp @@ -162,9 +162,10 @@ wxThread::ExitCode DemodulatorThread::Entry() { break; } } + } else { + this->Yield(); + this->Sleep(1); } - - Sleep(1000); } std::cout << std::endl << "Demodulator Thread Done." << std::endl << std::endl; diff --git a/src/SDRThread.cpp b/src/SDRThread.cpp index fc7a23c..d5f0824 100644 --- a/src/SDRThread.cpp +++ b/src/SDRThread.cpp @@ -1,6 +1,7 @@ #include "SDRThread.h" #include "CubicSDRDefs.h" #include +#include "CubicSDR.h" //wxDEFINE_EVENT(wxEVT_COMMAND_SDRThread_INPUT, wxThreadEvent); @@ -159,6 +160,9 @@ wxThread::ExitCode SDRThread::Entry() { } else { delete new_buffer; } + } else { + this->Yield(); + this->Sleep(1); } } std::cout << std::endl << "Done." << std::endl << std::endl;