Allow frequencies outside of the normal band.

This commit is contained in:
zeitbinder 2014-11-08 23:34:26 +01:00
parent 300414ef5e
commit abfb6d9455
1 changed files with 12 additions and 2 deletions

View File

@ -216,13 +216,23 @@ static void
fatal(char *fmt, ...) fatal(char *fmt, ...)
{ {
va_list ap; va_list ap;
fprintf(stderr,"ERROR: ");
va_start(ap, fmt); va_start(ap, fmt);
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
va_end(ap); va_end(ap);
terminate(0); terminate(0);
} }
static void
warn(char *fmt, ...)
{
va_list ap;
fprintf(stderr,"WARNING: ");
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
}
static uint32_t static uint32_t
mem_virt_to_phys(void *virt) mem_virt_to_phys(void *virt)
{ {
@ -537,7 +547,7 @@ int main(int argc, char **argv) {
i++; i++;
carrier_freq = 1e6 * atof(param); carrier_freq = 1e6 * atof(param);
if(carrier_freq < 87500000 || carrier_freq > 108000000) if(carrier_freq < 87500000 || carrier_freq > 108000000)
fatal("Incorrect frequency specification. Must be in megahertz, of the form 107.9\n"); warn("Frequency should be in megahertz between 87.5 and 108.0, but is %f MHz\n",atof(param));
} else if(strcmp("-pi", arg)==0 && param != NULL) { } else if(strcmp("-pi", arg)==0 && param != NULL) {
i++; i++;
pi = (uint16_t) strtol(param, NULL, 16); pi = (uint16_t) strtol(param, NULL, 16);