minimodem: handle SIGINT on --rx: close the sa backend and print stats
This commit is contained in:
parent
9627669b24
commit
761cf00b16
|
@ -258,6 +258,15 @@ benchmarks()
|
|||
}
|
||||
|
||||
|
||||
static int rx_stop = 0;
|
||||
|
||||
void
|
||||
rx_stop_sighandler( int sig )
|
||||
{
|
||||
rx_stop = 1;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
version()
|
||||
{
|
||||
|
@ -810,8 +819,13 @@ main( int argc, char*argv[] )
|
|||
|
||||
float track_amplitude = 0.0;
|
||||
|
||||
signal(SIGINT, rx_stop_sighandler);
|
||||
|
||||
while ( 1 ) {
|
||||
|
||||
if ( rx_stop )
|
||||
break;
|
||||
|
||||
debug_log("advance=%u\n", advance);
|
||||
|
||||
/* Shift the samples in samplebuf by 'advance' samples */
|
||||
|
@ -1148,6 +1162,8 @@ main( int argc, char*argv[] )
|
|||
|
||||
} /* end of the main loop */
|
||||
|
||||
signal(SIGINT, SIG_DFL);
|
||||
|
||||
if ( carrier ) {
|
||||
if ( !quiet_mode )
|
||||
report_no_carrier(fskp, sample_rate, bfsk_data_rate,
|
||||
|
|
Loading…
Reference in New Issue