reduce logspam in sdr.c
This commit is contained in:
@@ -35,6 +35,7 @@ enum paging_signal;
|
|||||||
#include "../libmobile/sender.h"
|
#include "../libmobile/sender.h"
|
||||||
#include "sdr_config.h"
|
#include "sdr_config.h"
|
||||||
#include "sdr.h"
|
#include "sdr.h"
|
||||||
|
#include <time.h>
|
||||||
#ifdef HAVE_UHD
|
#ifdef HAVE_UHD
|
||||||
#include "uhd.h"
|
#include "uhd.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -981,7 +982,12 @@ int sdr_read(void *inst, sample_t **samples, int num, int channels, double *rf_l
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sdr_rx_overflow) {
|
if (sdr_rx_overflow) {
|
||||||
LOGP(DSDR, LOGL_ERROR, "SDR RX overflow!\n");
|
static double last_log=0;
|
||||||
|
double now = get_time();
|
||||||
|
if (now - last_log > 1.0) { // Log once per second to reduce logspam
|
||||||
|
LOGP(DSDR, LOGL_ERROR, "SDR RX overflow!\n");
|
||||||
|
last_log = now;
|
||||||
|
}
|
||||||
sdr_rx_overflow = 0;
|
sdr_rx_overflow = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user