From 724a44e0c426dea11d2c03c524e84ead1da3f457 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Thu, 31 Oct 2024 17:29:23 +0000 Subject: [PATCH] Fix compilation bug and add lost start call. --- FMControl.cpp | 11 +++++++++-- Version.h | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/FMControl.cpp b/FMControl.cpp index bab84e2..54def9f 100644 --- a/FMControl.cpp +++ b/FMControl.cpp @@ -78,7 +78,7 @@ const float FILTER_TAPS[] = { const unsigned int FILTER_TAPS_COUNT = 200U; -CFMControl::CFMControl(CFMNetwork* network, float txAudioGain, float rxAudioGain, bool preEmphasisOn, bool deEmphasisOn) : +CFMControl::CFMControl(IFMNetwork* network, float txAudioGain, float rxAudioGain, bool preEmphasisOn, bool deEmphasisOn) : m_network(network), m_txAudioGain(txAudioGain), m_rxAudioGain(rxAudioGain), @@ -110,12 +110,19 @@ bool CFMControl::writeModem(const unsigned char* data, unsigned int length) if (data[0U] == TAG_HEADER) return true; - if (data[0U] == TAG_EOT) + if (data[0U] == TAG_EOT) { + m_begin = true; return m_network->writeEnd(); + } if (data[0U] != TAG_DATA) return false; + if (m_begin) { + m_begin = false; + m_network->writeStart(); + } + m_incomingRFAudio.addData(data + 1U, length - 1U); unsigned int bufferLength = m_incomingRFAudio.dataSize(); if (bufferLength > 240U) // 160 samples 12-bit diff --git a/Version.h b/Version.h index fcb4eb5..79c529e 100644 --- a/Version.h +++ b/Version.h @@ -19,6 +19,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20240930"; +const char* VERSION = "20241031"; #endif