From c9d53ed96ea053d847c33e4b31d2dc3c842ea270 Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Wed, 3 Jan 2024 00:33:54 +0100 Subject: [PATCH] Ensure that buffer is full when transmission starts --- impl/src/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/impl/src/main.c b/impl/src/main.c index 030ade1..98d6052 100644 --- a/impl/src/main.c +++ b/impl/src/main.c @@ -261,13 +261,14 @@ int main(void) dump_array_cf(whole_burst, burst_len, 1.0f, "/tmp/tx.cpx"); + // ensure that the buffer is full before TX is turned on to avoid transmitting empty buffers + RESULT_CHECK(transmit_in_chunks(&sdr, whole_burst, burst_len)); + if(!on_air) { RESULT_CHECK(sdr_stop_rx(&sdr)); RESULT_CHECK(sdr_start_tx(&sdr, burst_len * SDR_OVERSAMPLING)); } - RESULT_CHECK(transmit_in_chunks(&sdr, whole_burst, burst_len)); - on_air = true; } else if(on_air) { // ret == 0 RESULT_CHECK(sdr_flush_tx_buffer(&sdr));