From ad83ef5df32fdc425ac539ecdc7d4b0a14c6764a Mon Sep 17 00:00:00 2001 From: Kamal Mostafa Date: Wed, 13 Apr 2016 09:32:35 -0700 Subject: [PATCH] Refactor emit idle tone (no functional change) Clean up the "emit idle tone" code, which should never have involved tx_leader_bits_len (that was a copy-paste laziness). "Emit idle tone" simply generates the idle tone for a hardcoded period of time now codified as 'idle_tone_usec' and set to 1/25 of a second (to match the existing behavior). --- src/minimodem.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/minimodem.c b/src/minimodem.c index 181ef36..013d760 100644 --- a/src/minimodem.c +++ b/src/minimodem.c @@ -142,6 +142,9 @@ static void fsk_transmit_stdin( {0, 0} // it_value }; + // arbitrary chosen timeout value: 1/25 of a second + unsigned int idle_carrier_usec = (1000000/25); + int block_input = tx_interactive && !txcarrier; if ( block_input ) signal(SIGALRM, tx_stop_transmit_sighandler); @@ -211,10 +214,10 @@ static void fsk_transmit_stdin( else { tx_transmitting = 1; - unsigned int j; /* emit idle tone (mark) */ - for ( j=0; j