Skip to content

Commit

Permalink
libbladeRF/bladerf1.c: add AGC log_error output
Browse files Browse the repository at this point in the history
Add log_error() output to help the user figure out why they're receiving
ERR_UNSUPPORTED.
  • Loading branch information
bglod authored and rtucker committed Sep 14, 2018
1 parent b9eeb7e commit 970e6f7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c
Expand Up @@ -1607,12 +1607,18 @@ static int bladerf1_set_gain_mode(struct bladerf *dev,
}

if (mode == BLADERF_GAIN_AUTOMATIC || mode == BLADERF_GAIN_DEFAULT) {
if (!have_cap(board_data->capabilities, BLADERF_CAP_AGC_DC_LUT) ||
!board_data->cal.dc_rx) {
if (!have_cap(board_data->capabilities, BLADERF_CAP_AGC_DC_LUT)) {
log_error("This FPGA version does not support AGC.\n");
return BLADERF_ERR_UNSUPPORTED;
}

if (!board_data->cal.dc_rx) {
log_error("RX DC calibration table not found for this board.\n");
return BLADERF_ERR_UNSUPPORTED;
}

if (board_data->cal.dc_rx->version != 2) {
log_error("Incompatible RX DC calibration table version.\n");
return BLADERF_ERR_UNSUPPORTED;
}

Expand Down

0 comments on commit 970e6f7

Please sign in to comment.