diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-04-16 10:15:25 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-04-16 10:15:25 +0200 |
commit | 5e08ec5d0d71857b21536221f6fda9c936afa7e0 (patch) | |
tree | 6492bc3d1315aa285ad0424e0f71a8de7bee5f4c /src | |
parent | a878abd2aa41f530a558ee83639832d907a24029 (diff) | |
download | dabmod-5e08ec5d0d71857b21536221f6fda9c936afa7e0.tar.gz dabmod-5e08ec5d0d71857b21536221f6fda9c936afa7e0.tar.bz2 dabmod-5e08ec5d0d71857b21536221f6fda9c936afa7e0.zip |
Do not compile useless files for easydabv3
Diffstat (limited to 'src')
-rw-r--r-- | src/DabMod.cpp | 30 | ||||
-rw-r--r-- | src/Utils.cpp | 36 |
2 files changed, 38 insertions, 28 deletions
diff --git a/src/DabMod.cpp b/src/DabMod.cpp index 0d4a180..bc32b9d 100644 --- a/src/DabMod.cpp +++ b/src/DabMod.cpp @@ -29,6 +29,22 @@ # include "config.h" #endif +#include <memory> +#include <complex> +#include <string> +#include <iostream> +#include <iomanip> +#include <cstdlib> +#include <stdexcept> +#include <cstdio> +#include <cstddef> +#include <sys/stat.h> +#include <signal.h> + +#if HAVE_NETINET_IN_H +# include <netinet/in.h> +#endif + #include "Utils.h" #include "Log.h" #include "DabModulator.h" @@ -47,20 +63,6 @@ #include "RemoteControl.h" #include "ConfigParser.h" -#include <memory> -#include <complex> -#include <string> -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <stdexcept> -#include <signal.h> - -#if HAVE_NETINET_IN_H -# include <netinet/in.h> -#endif - /* UHD requires the input I and Q samples to be in the interval * [-1.0,1.0], otherwise they get truncated, which creates very * wide-spectrum spikes. Depending on the Transmission Mode, the diff --git a/src/Utils.cpp b/src/Utils.cpp index 4d97359..50af4fb 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -62,12 +62,14 @@ static void printHeader() "SSE " << #endif "\n"; + +#if defined(BUILD_FOR_EASYDABV3) + std::cerr << " This is a build for the EasyDABv3 board" << std::endl; +#endif } void printUsage(const char* progName) { - printHeader(); - FILE* out = stderr; fprintf(out, "Usage with configuration file:\n"); fprintf(out, "\t%s config_file.ini\n\n", progName); @@ -75,19 +77,25 @@ void printUsage(const char* progName) fprintf(out, "Usage with command line options:\n"); fprintf(out, "\t%s" " input" +#if defined(BUILD_FOR_EASYDABV3) + " -f filename -F format" +#else " (-f filename -F format | -u uhddevice -F frequency)" +#endif + " [-o offset]" +#if !defined(BUILD_FOR_EASYDABV3) "\n\t" " [-G txgain]" - " [-o offset]" " [-T filter_taps_file]" " [-a gain]" " [-c clockrate]" "\n\t" " [-g gainMode]" - " [-h]" - " [-l]" " [-m dabMode]" " [-r samplingRate]" +#endif + " [-l]" + " [-h]" "\n", progName); fprintf(out, "Where:\n"); fprintf(out, "input: ETI input filename (default: stdin), or\n"); @@ -96,35 +104,35 @@ void printUsage(const char* progName) fprintf(out, " udp://:port for EDI input.\n"); fprintf(out, "-f name: Use file output with given filename. (use /dev/stdout for standard output)\n"); fprintf(out, "-F format: Set the output format (see doc/example.ini for formats) for the file output.\n"); - fprintf(out, "-u device: Use UHD output with given device string. (use "" for default device)\n"); - fprintf(out, "-F frequency: Set the transmit frequency when using UHD output. (mandatory option when using UHD)\n"); - fprintf(out, "-G txgain: Set the transmit gain for the UHD driver (default: 0)\n"); - fprintf(out, "-o: (UHD only) Set the timestamp offset added to the timestamp in the ETI. The offset is a double.\n"); + fprintf(out, "-o: Set the timestamp offset added to the timestamp in the ETI. The offset is a double.\n"); fprintf(out, " Specifying this option has two implications: It enables synchronous transmission,\n" " requiring an external REFCLK and PPS signal and frames that do not contain a valid timestamp\n" " get muted.\n\n"); +#if !defined(BUILD_FOR_EASYDABV3) + fprintf(out, "-u device: Use UHD output with given device string. (use "" for default device)\n"); + fprintf(out, "-F frequency: Set the transmit frequency when using UHD output. (mandatory option when using UHD)\n"); + fprintf(out, "-G txgain: Set the transmit gain for the UHD driver (default: 0)\n"); fprintf(out, "-T taps_file: Enable filtering before the output, using the specified file containing the filter taps.\n"); fprintf(out, " Use 'default' as taps_file to use the internal taps.\n"); fprintf(out, "-a gain: Apply digital amplitude gain.\n"); fprintf(out, "-c rate: Set the DAC clock rate and enable Cic Equalisation.\n"); fprintf(out, "-g gainmode: Set computation gain mode: fix, max or var\n"); - fprintf(out, "-h: Print this help.\n"); - fprintf(out, "-l: Loop file when reach end of file.\n"); fprintf(out, "-m mode: Set DAB mode: (0: auto, 1-4: force).\n"); fprintf(out, "-r rate: Set output sampling rate (default: 2048000).\n\n"); +#endif + fprintf(out, "-l: Loop file when reach end of file.\n"); + fprintf(out, "-h: Print this help.\n"); } void printVersion(void) { - printHeader(); - FILE *out = stderr; fprintf(out, " ODR-DabMod is copyright (C) Her Majesty the Queen in Right of Canada,\n" " 2005 -- 2012 Communications Research Centre (CRC),\n" " and\n" - " Copyright (C) 2017 Matthias P. Braendli, matthias.braendli@mpb.li\n" + " Copyright (C) 2018 Matthias P. Braendli, matthias.braendli@mpb.li\n" "\n" " http://opendigitalradio.org\n" "\n" |