From 978842a2ff47275271bf1c3157a11b1abd16452d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Wed, 25 Nov 2020 15:42:24 +0100 Subject: [PATCH] Full init when switching to any other mode than idle --- Software/VNA_embedded/Application/App.cpp | 2 -- Software/VNA_embedded/Application/Generator.cpp | 2 +- Software/VNA_embedded/Application/Hardware.cpp | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Software/VNA_embedded/Application/App.cpp b/Software/VNA_embedded/Application/App.cpp index 2a69028..da946f7 100644 --- a/Software/VNA_embedded/Application/App.cpp +++ b/Software/VNA_embedded/Application/App.cpp @@ -97,7 +97,6 @@ void App_Start() { USB_EN_GPIO_Port->BSRR = USB_EN_Pin; #endif - uint32_t lastNewPoint = HAL_GetTick(); bool sweepActive = false; LED::Off(); @@ -110,7 +109,6 @@ void App_Start() { case Protocol::PacketType::SweepSettings: LOG_INFO("New settings received"); sweepActive = VNA::Setup(recv_packet.settings); - lastNewPoint = HAL_GetTick(); Communication::SendWithoutPayload(Protocol::PacketType::Ack); break; case Protocol::PacketType::ManualControl: diff --git a/Software/VNA_embedded/Application/Generator.cpp b/Software/VNA_embedded/Application/Generator.cpp index 77173c5..1df2845 100644 --- a/Software/VNA_embedded/Application/Generator.cpp +++ b/Software/VNA_embedded/Application/Generator.cpp @@ -8,7 +8,7 @@ void Generator::Setup(Protocol::GeneratorSettings g) { if(g.activePort == 0) { // both ports disabled, no need to configure PLLs - HW::SetMode(HW::Mode::Idle); + HW::SetIdle(); return; } Protocol::ManualControl m; diff --git a/Software/VNA_embedded/Application/Hardware.cpp b/Software/VNA_embedded/Application/Hardware.cpp index a211094..ad25a2d 100644 --- a/Software/VNA_embedded/Application/Hardware.cpp +++ b/Software/VNA_embedded/Application/Hardware.cpp @@ -192,7 +192,7 @@ void HW::SetMode(Mode mode) { default: break; } - if(mode != Mode::Idle && activeMode != Mode::Idle) { + if(mode != Mode::Idle) { // do a full initialization when switching directly between modes HW::Init(); }