Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions src/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,8 @@ void write_stats_file(timeval *last_stats_write) {
timeval current_time;
gettimeofday(&current_time, NULL);

static const double STATS_FILE_TIMING = 15.0;
if (!do_exit && delta_sec(last_stats_write, &current_time) < STATS_FILE_TIMING) {
extern int stats_update_interval;
if (!do_exit && delta_sec(last_stats_write, &current_time) < stats_update_interval ) {
return;
}

Expand Down
5 changes: 5 additions & 0 deletions src/rtl_airband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ bool log_scan_activity = false;
char *stats_filepath = NULL;
size_t fft_size_log = DEFAULT_FFT_SIZE_LOG;
size_t fft_size = 1 << fft_size_log;
int stats_update_interval = 15; // Stats update every 15 seconf by default
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
int stats_update_interval = 15; // Stats update every 15 seconf by default
int stats_update_interval = 15; // Stats update every 15 seconds by default


#ifdef NFM
float alpha = exp(-1.0f/(WAVE_RATE * 2e-4));
Expand Down Expand Up @@ -846,6 +847,10 @@ int main(int argc, char* argv[]) {
log_scan_activity = true;
if(root.exists("stats_filepath"))
stats_filepath = strdup(root["stats_filepath"]);
if (root.exists("stats_update_interval")) {
stats_update_interval = (int)root["stats_update_interval"];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any validation we should do on the value? Ie, >0?

}

#ifdef NFM
if(root.exists("tau"))
alpha = ((int)root["tau"] == 0 ? 0.0f : exp(-1.0f/(WAVE_RATE * 1e-6 * (int)root["tau"])));
Expand Down
1 change: 1 addition & 0 deletions src/rtl_airband.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ extern volatile int do_exit, device_opened;
extern float alpha;
extern device_t *devices;
extern mixer_t *mixers;
extern int stats_update_interval;

// util.cpp
int atomic_inc(volatile int *pv);
Expand Down