Skip to content

Commit

Permalink
use parse_frequency on sample rate inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
ka9q committed May 5, 2024
1 parent 688caea commit 5640b9e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions control.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,13 +728,11 @@ static int process_keyboard(struct channel *channel,uint8_t **bpp,int c){
break;
case 'S':
{
char str[Entry_width],*ptr;
char str[Entry_width];
getentry("Output sample rate, Hz: ",str,sizeof(str));
int samprate = strtol(str,&ptr,0);
if(ptr != str){
channel->output.samprate = samprate;
encode_int(bpp,OUTPUT_SAMPRATE,channel->output.samprate);
}
int samprate = parse_frequency(str,false);
channel->output.samprate = samprate;
encode_int(bpp,OUTPUT_SAMPRATE,channel->output.samprate);
}
break;
case 's': // Squelch threshold for current mode
Expand Down

0 comments on commit 5640b9e

Please sign in to comment.