bugfix, 3rd try: avoid printing "PLL not locked"

* bugfix wrong return value in r82xx_set_pll(),
when "PLL not locked" was printed.
removed all similar messages - regarded as noise,
e.g. when running rtl_test -t
* suppress output of tuning band 0 - 0 Hz in rtl_test

Signed-off-by: hayati ayguen <h_ayguen@web.de>
development
hayati ayguen 2020-08-21 13:29:10 -07:00
parent 4123e706ee
commit e315a41ec5
2 changed files with 12 additions and 3 deletions

View File

@ -280,11 +280,13 @@ static uint32_t min_step(uint32_t freq) {
}
static void report_band_start(uint32_t start) {
fprintf(stderr, "Found a new band starting at %u Hz\n", start);
if (start)
fprintf(stderr, "Found a new band starting at %u Hz\n", start);
}
static void report_band(uint32_t low, uint32_t high) {
fprintf(stderr, "Tuning band: %u - %u Hz\n", low, high);
if ( low != high && low )
fprintf(stderr, "Tuning band: %u - %u Hz\n\n", low, high);
}
void tuner_benchmark(void)

View File

@ -31,6 +31,7 @@
#include "tuner_r82xx.h"
#define WITH_ASYM_FILTER 0
#define PRINT_PLL_ERRORS 0
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
@ -802,7 +803,9 @@ static int r82xx_set_pll(struct r82xx_priv *priv, uint32_t freq)
#endif
if (nint > ((128 / vco_power_ref) - 1)) {
#if PRINT_PLL_ERRORS
fprintf(stderr, "[R82XX] No valid PLL values for %u Hz!\n", freq);
#endif
return -1;
}
@ -848,10 +851,12 @@ static int r82xx_set_pll(struct r82xx_priv *priv, uint32_t freq)
}
if (!(data[2] & 0x40)) {
#if PRINT_PLL_ERRORS
fprintf(stderr, "[R82XX] PLL not locked at Tuner LO %u Hz for RF %u Hz!\n",
freq, priv->rf_freq);
#endif
priv->has_lock = 0;
return 0;
return -1;
}
#if 0
else
@ -1605,8 +1610,10 @@ int r82xx_set_freq(struct r82xx_priv *priv, uint32_t freq)
}
err:
#if PRINT_PLL_ERRORS
if (rc < 0)
fprintf(stderr, "%s: failed=%d\n", __FUNCTION__, rc);
#endif
return rc;
}