Strip out the long-dead --debug option code.

This commit is contained in:
Oliver Jowett 2020-08-05 20:14:57 +08:00
parent ce5cf89e60
commit ce521f715a
2 changed files with 2 additions and 39 deletions

View File

@ -322,7 +322,6 @@ static void showHelp(void)
"--metric Use metric units (meters, km/h, ...)\n"
"--gnss Show altitudes as HAE/GNSS (with H suffix) when available\n"
"--snip <level> Strip IQ file removing samples < level\n"
"--debug <flags> Debug mode (verbose), see README for details\n"
"--quiet Disable output to stdout. Use for daemon applications\n"
"--show-only <addr> Show only messages from the given ICAO on stdout\n"
"--write-json <dir> Periodically write json output to <dir> (for serving by a separate webserver)\n"
@ -331,14 +330,6 @@ static void showHelp(void)
"--dcfilter Apply a 1Hz DC filter to input data (requires more CPU)\n"
"--version Show version and build options\n"
"--help Show this help\n"
"\n"
"Debug mode flags: d = Log frames decoded with errors\n"
" D = Log frames decoded with zero errors\n"
" c = Log frames with bad CRC\n"
" C = Log frames with good CRC\n"
" p = Log frames with bad preamble\n"
" n = Log network debugging info\n"
" j = Log frames to frames.js, loadable by debug.html\n"
);
}
@ -565,23 +556,8 @@ int main(int argc, char **argv) {
} else if (!strcmp(argv[j],"--max-range") && more) {
Modes.maxRange = atof(argv[++j]) * 1852.0; // convert to metres
} else if (!strcmp(argv[j],"--debug") && more) {
char *f = argv[++j];
while(*f) {
switch(*f) {
case 'D': Modes.debug |= MODES_DEBUG_DEMOD; break;
case 'd': Modes.debug |= MODES_DEBUG_DEMODERR; break;
case 'C': Modes.debug |= MODES_DEBUG_GOODCRC; break;
case 'c': Modes.debug |= MODES_DEBUG_BADCRC; break;
case 'p': Modes.debug |= MODES_DEBUG_NOPREAMBLE; break;
case 'n': Modes.debug |= MODES_DEBUG_NET; break;
case 'j': Modes.debug |= MODES_DEBUG_JS; break;
default:
fprintf(stderr, "Unknown debugging flag: %c\n", *f);
exit(1);
break;
}
f++;
}
fprintf(stderr, "warning: --debug is obsolete and ignored\n");
++j;
} else if (!strcmp(argv[j],"--stats")) {
if (!Modes.stats)
Modes.stats = (uint64_t)1 << 60; // "never"

View File

@ -232,18 +232,6 @@ typedef enum {
#define MODES_NON_ICAO_ADDRESS (1<<24) // Set on addresses to indicate they are not ICAO addresses
#define MODES_DEBUG_DEMOD (1<<0)
#define MODES_DEBUG_DEMODERR (1<<1)
#define MODES_DEBUG_BADCRC (1<<2)
#define MODES_DEBUG_GOODCRC (1<<3)
#define MODES_DEBUG_NOPREAMBLE (1<<4)
#define MODES_DEBUG_NET (1<<5)
#define MODES_DEBUG_JS (1<<6)
// When debug is set to MODES_DEBUG_NOPREAMBLE, the first sample must be
// at least greater than a given level for us to dump the signal.
#define MODES_DEBUG_NOPREAMBLE_LEVEL 25
#define MODES_INTERACTIVE_REFRESH_TIME 250 // Milliseconds
#define MODES_INTERACTIVE_DISPLAY_TTL 60000 // Delete from display after 60 seconds
@ -328,7 +316,6 @@ struct _Modes { // Internal state
int raw; // Raw output format
int mode_ac; // Enable decoding of SSR Modes A & C
int mode_ac_auto; // allow toggling of A/C by Beast commands
int debug; // Debugging mode
int net; // Enable networking
int net_only; // Enable just networking
uint64_t net_heartbeat_interval; // TCP heartbeat interval (milliseconds)