From 6bf70a95953b9b3ea17b2af5f6b98a70057ae801 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Thu, 3 Mar 2016 18:34:47 +0000 Subject: [PATCH] A cleaner lockout mechanism on receive. --- IO.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/IO.cpp b/IO.cpp index 51029ab..42cedb6 100644 --- a/IO.cpp +++ b/IO.cpp @@ -253,19 +253,6 @@ void CIO::process() #endif } - if (m_lockout) { - // Drain the receive queue - if (m_rxBuffer.getData() >= RX_BLOCK_SIZE) { - for (uint16_t i = 0U; i < RX_BLOCK_SIZE; i++) { - uint16_t sample; - uint8_t control; - m_rxBuffer.get(sample, control); - } - } - - return; - } - if (m_rxBuffer.getData() >= RX_BLOCK_SIZE) { q15_t samples[RX_BLOCK_SIZE]; uint8_t control[RX_BLOCK_SIZE]; @@ -284,6 +271,9 @@ void CIO::process() samples[i] = q15_t(__SSAT((res2 >> 15), 16)); } + if (m_lockout) + return; + if (m_modemState == STATE_IDLE) { if (m_dstarEnable) { q15_t GMSKVals[RX_BLOCK_SIZE];