From a9312aab4d07698c78d4829c7bd612e4ce8d87cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Tue, 7 Jun 2022 16:13:45 +0200 Subject: [PATCH] Fix floating point limitation in frequency correction --- Software/VNA_embedded/Application/Cal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Software/VNA_embedded/Application/Cal.cpp b/Software/VNA_embedded/Application/Cal.cpp index d740dbd..d94889b 100644 --- a/Software/VNA_embedded/Application/Cal.cpp +++ b/Software/VNA_embedded/Application/Cal.cpp @@ -154,7 +154,7 @@ uint64_t Cal::FrequencyCorrectionToDevice(uint64_t freq) { // The frequency calibration is only used when the internal reference is active. // If an external reference is in use, it is assumed to already be at the correct frequency if(!HW::Ref::usingExternal()) { - freq -= freq * cal.TCXO_PPM_correction * 1e-6f; + freq -= (int32_t) (freq * cal.TCXO_PPM_correction * 1e-6f); } return freq; }