mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 06:53:37 +00:00
Bugfix: race condition removed when changing settings on fast sweep
This commit is contained in:
parent
967d72c11e
commit
eb64e042f4
5 changed files with 284 additions and 298 deletions
|
|
@ -30,8 +30,6 @@ static void HaltedCallback() {
|
|||
}
|
||||
}
|
||||
|
||||
static HW::WorkRequest requestWork;
|
||||
|
||||
static void ReadComplete(FPGA::SamplingResult result) {
|
||||
bool needs_work = false;
|
||||
switch(activeMode) {
|
||||
|
|
@ -47,8 +45,8 @@ static void ReadComplete(FPGA::SamplingResult result) {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
if(needs_work && requestWork) {
|
||||
STM::DispatchToInterrupt(requestWork);
|
||||
if(needs_work) {
|
||||
STM::DispatchToInterrupt(HW::Work);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -72,8 +70,7 @@ void HW::Work() {
|
|||
}
|
||||
}
|
||||
|
||||
bool HW::Init(WorkRequest wr) {
|
||||
requestWork = wr;
|
||||
bool HW::Init() {
|
||||
LOG_DEBUG("Initializing...");
|
||||
|
||||
activeMode = Mode::Idle;
|
||||
|
|
@ -189,7 +186,7 @@ void HW::SetMode(Mode mode) {
|
|||
}
|
||||
if(mode != Mode::Idle && activeMode != Mode::Idle) {
|
||||
// do a full initialization when switching directly between modes
|
||||
HW::Init(requestWork);
|
||||
HW::Init();
|
||||
}
|
||||
SetIdle();
|
||||
activeMode = mode;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue