Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions dump1090.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ struct {
int enable_agc;
rtlsdr_dev_t *dev;
int freq;
int ppm;

/* Networking */
char aneterr[ANET_ERR_LEN];
Expand Down Expand Up @@ -274,6 +275,7 @@ void modesInitConfig(void) {
Modes.interactive_ttl = MODES_INTERACTIVE_TTL;
Modes.aggressive = 0;
Modes.interactive_rows = getTermRows();
Modes.ppm=0;
}

void modesInit(void) {
Expand Down Expand Up @@ -334,8 +336,7 @@ void modesInit(void) {
void modesInitRTLSDR(void) {
int j;
int device_count;
int ppm_error = 0;
char vendor[256], product[256], serial[256];
char vendor[256], product[256], serial[256];

device_count = rtlsdr_get_device_count();
if (!device_count) {
Expand Down Expand Up @@ -374,7 +375,7 @@ void modesInitRTLSDR(void) {
} else {
fprintf(stderr, "Using automatic gain control.\n");
}
rtlsdr_set_freq_correction(Modes.dev, ppm_error);
rtlsdr_set_freq_correction(Modes.dev, Modes.ppm);
if (Modes.enable_agc) rtlsdr_set_agc_mode(Modes.dev, 1);
rtlsdr_set_center_freq(Modes.dev, Modes.freq);
rtlsdr_set_sample_rate(Modes.dev, MODES_DEFAULT_RATE);
Expand Down Expand Up @@ -2422,6 +2423,7 @@ void showHelp(void) {
"--gain <db> Set gain (default: max gain. Use -100 for auto-gain).\n"
"--enable-agc Enable the Automatic Gain Control (default: off).\n"
"--freq <hz> Set frequency (default: 1090 Mhz).\n"
"--ppm <ppm> Set ppm error (default: 0).\n"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add another extra missing whitespace

"--ifile <filename> Read data from file (use '-' for stdin).\n"
"--interactive Interactive mode refreshing data on screen.\n"
"--interactive-rows <num> Max number of rows in interactive mode (default: 15).\n"
Expand Down Expand Up @@ -2492,6 +2494,8 @@ int main(int argc, char **argv) {
Modes.enable_agc++;
} else if (!strcmp(argv[j],"--freq") && more) {
Modes.freq = strtoll(argv[++j],NULL,10);
} else if (!strcmp(argv[j],"--ppm") && more) {
Modes.ppm = strtoll(argv[++j],NULL,10);
} else if (!strcmp(argv[j],"--ifile") && more) {
Modes.filename = strdup(argv[++j]);
} else if (!strcmp(argv[j],"--no-fix")) {
Expand Down