From acfeecf0a671f6d1f0a8003d467289c3cbd4adaf Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Sun, 19 Jan 2025 22:42:04 +0100 Subject: [PATCH] Fixed: OIRT frequency was not added to logbook --- src/logbook.cpp | 9 +++++---- src/logbook.h | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/logbook.cpp b/src/logbook.cpp index 2251ef8..95d65e6 100644 --- a/src/logbook.cpp +++ b/src/logbook.cpp @@ -243,11 +243,12 @@ byte addRowToCSV() { } // Prepare the frequency in a formatted string (e.g., "XX.XX MHz") - int freqInt = (int)frequency; // Cast the frequency value to an integer - int convertedFreq = (freqInt + ConverterSet * 100) / 100; // Apply necessary conversion + int freqInt; + if (band == BAND_OIRT) freqInt = (int)frequency_OIRT; else freqInt = (int)frequency; // Cast the frequency value to an integer + int convertedFreq = (freqInt + (band != BAND_OIRT ? ConverterSet * 100 : 0)) / 100; // Apply necessary conversion String frequencyFormatted = String(convertedFreq) + "." + - ((freqInt + ConverterSet * 100) % 100 < 10 ? "0" : "") + - String((freqInt + ConverterSet * 100) % 100) + " MHz"; + ((freqInt + (band != BAND_OIRT ? ConverterSet * 100 : 0)) % 100 < 10 ? "0" : "") + + String((freqInt + (band != BAND_OIRT ? ConverterSet * 100 : 0)) % 100) + " MHz"; // Calculate signal strength based on the selected unit int SStatusprint = 0; diff --git a/src/logbook.h b/src/logbook.h index 75bd5f7..02ea104 100644 --- a/src/logbook.h +++ b/src/logbook.h @@ -12,12 +12,14 @@ extern bool autoDST; extern bool clockampm; extern bool NTPupdated; extern bool rtcset; +extern byte band; extern byte language; extern byte unit; extern int16_t SStatus; extern int8_t NTPoffset; extern unsigned int ConverterSet; extern unsigned int frequency; +extern unsigned int frequency_OIRT; extern unsigned int logcounter; extern TEF6686 radio;