From fc8eee58e7874fac19e6685f495bb754292e1447 Mon Sep 17 00:00:00 2001 From: Andre Dunford Date: Sun, 18 Dec 2022 16:54:47 -0800 Subject: [PATCH] relocate standby condition --- Software/VNA_embedded/Application/App.cpp | 2 +- Software/VNA_embedded/Application/Hardware.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Software/VNA_embedded/Application/App.cpp b/Software/VNA_embedded/Application/App.cpp index 86e2649..2ac489b 100644 --- a/Software/VNA_embedded/Application/App.cpp +++ b/Software/VNA_embedded/Application/App.cpp @@ -324,7 +324,7 @@ inline void App_Process() { } } } - if(!VNA::GetStandbyMode() && HW::TimedOut()) { + if(HW::TimedOut()) { HW::SetMode(HW::Mode::Idle); // insert the last received packet (restarts the timed out operation) Communication::BlockNextAck(); diff --git a/Software/VNA_embedded/Application/Hardware.cpp b/Software/VNA_embedded/Application/Hardware.cpp index f45fb78..dc675a5 100644 --- a/Software/VNA_embedded/Application/Hardware.cpp +++ b/Software/VNA_embedded/Application/Hardware.cpp @@ -303,7 +303,7 @@ bool HW::TimedOut() { auto bufISR = lastISR; uint64_t now = Delay::get_us(); uint64_t timeSinceLast = now - bufISR; - if(activeMode != Mode::Idle && activeMode != Mode::Generator && timeSinceLast > timeout) { + if(activeMode != Mode::Idle && activeMode != Mode::Generator && !VNA::GetStandbyMode() && timeSinceLast > timeout) { LOG_WARN("Timed out, last ISR was at %lu%06lu, now %lu%06lu" , (uint32_t) (bufISR / 1000000), (uint32_t)(bufISR%1000000) , (uint32_t) (now / 1000000), (uint32_t)(now%1000000));