The nominal DC offset values were being left up to the caller to
apply. However, the bladeRF-cli was not doing this.
For convenience, these functions now apply the resulting nominal
values identified before exiting.
Use CONST variants of macros when assigning constants.
For values that are not constants, the declaration and assignments
have been separated just to avoid any potential future C89
shenanigans.
The existing macros make use of functions, which cannot be used to
define constants on architectures where they are actually implemented
as functions (as opposed to macros).
These functions come with MSVC 2015 (vc14) as part of the c99 support.
The compatibility definitions in host_config.h.in were causing
a compilation error. This fix disables the compatibility definitions
when the more recent vc14 compiler is detected.
Our proto file must provide the absolute path to the thunk library,
whether it is in the current directory or in MATLABPATH (as is the
case with our Windows installer).
host/common/src/dc_calibration.c:584:19: error: ‘q_est’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
const int16_t max_est = (i_est > q_est) ? i_est : q_est;
^
host/common/src/dc_calibration.c:679:20: note: ‘q_est’ was declared here
int16_t i_est, q_est;
^
host/common/src/dc_calibration.c:584:19: error: ‘i_est’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
const int16_t max_est = (i_est > q_est) ? i_est : q_est;
^
host/common/src/dc_calibration.c:679:13: note: ‘i_est’ was declared here
int16_t i_est, q_est;
^
Ensure i_est and q_est are assigned fallback values in error cases.
host/utilities/bladeRF-cli/src/cmd/rxtx.c:753:8: error: ‘status’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (status == ETIMEDOUT) {
^
Initialize state of `status` to CLI_RET_UNKNOWN.
host/utilities/bladeRF-cli/src/cmd/printset.c:601:12: error: ‘lut_len’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
size_t lut_len;
^
host/utilities/bladeRF-cli/src/cmd/printset.c:600:31: error: ‘lut’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
const struct xb_gpio_lut *lut;
^
host/utilities/bladeRF-cli/src/cmd/printset.c:642:12: error: ‘lut_len’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
size_t lut_len, i;
^
Default lut_len to 0 and perform a sanity checks on lut & lut_len.
bladeRF/host/utilities/bladeRF-cli/src/cmd/poke.c:97:20: error: ‘f’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
status = f( state->dev, (uint8_t)address, (uint8_t)value );
^
Initialize f to NULL to calm GCC. In the cases where f is not assigned,
we should be erroring out at line 91. NULL check is performed on line
96.
Only seeing this warning with GCC - haven't observed this with
Clang or Coverity scans.
host/libraries/libbladeRF/src/device_identifier.c:121:22: error: ‘val’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
value[i] = tolower((unsigned char) c);
^
host/libraries/libbladeRF/src/device_identifier.c:175:34: note: ‘val’ was declared here
char *dev_id, *token, *arg, *val, *saveptr;
^
Addressing this by initializing ptrs to NULL and status variables to
BLADERF_ERR_UNEXPECTED. Added NULL pointer checks.
Per the libbladeRF API documentation, it is recommended to keep the RX
and TX frequencies >= 1 MHz apart. For consistency, the default
frequencies have been changed to follow this recommendation.
Additionally, the default frequencies have been moved within the 2.4 GHz
ISM band.
Addresses CID 1346524.
This should never happen because the count input is assigned
from a compile-time constant.
However, this check and assert() are worth having to verify
this assumption, should someone break the code later...
In the case where the timestamp was in the past we want to
try to resynchronize with the hardware's timestamp counter
rather than blindly increment the timestamp.
This addresses CID 1346525 due to the removal of a return
if status != 0 (rather than handling BLADERF_ERR_TIME_PAST).
Lead users away from using this shorthand in favor of setting
modules individually. This is intended to help avoid cases where
users see PLL artifacts, despite not actually needing modules
tuned to the same frequency.
Calibration and DC table generation now utilize the routines found
in host/common.
Although these do take noticably longer to execute, they generally yield
better results than the prior implementation.
This code is a re-designed set of DC calibration functionality
built atop of libbladeRF.
This functionality provides the ability to:
- Run LMS6002D DC calibrations per module (or all at once)
- Search for nominal RX/TX DC correction values for a single
frequencies or a range of frequencies.
To avoid inducing issue #408 by utilizing a single stream,
rather than repeatedly starting and stopping streams.
No TX thread is used, as this is uneccessary; it is sufficient to
flush 0+0j samples through the TX path at the start of calibration
and allow the DAC to remain held in this state as the FPGA
(intentionally) underruns.