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).
This commit is contained in:
Kamal Mostafa 2016-04-13 09:32:35 -07:00
parent 96a60f51b0
commit ad83ef5df3
1 changed files with 6 additions and 3 deletions

View File

@ -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<tx_leader_bits_len; j++ )
simpleaudio_tone(sa_out, invert_start_stop ? bfsk_space_f : bfsk_mark_f, sample_rate/50);
simpleaudio_tone(sa_out,
invert_start_stop ? bfsk_space_f : bfsk_mark_f,
idle_carrier_usec * sample_rate / 1000000);
}
if ( block_input )