mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 05:38:39 -05:00
Balanced thread performance w/ CPU usage
Seems smooth and responsive now.
This commit is contained in:
parent
739854cd7f
commit
1950c3109a
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "SDRThread.h"
|
||||
#include "CubicSDRDefs.h"
|
||||
#include <vector>
|
||||
#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;
|
||||
|
Loading…
Reference in New Issue
Block a user