Skip to content

Commit

Permalink
Fix getGain() for E4000
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcliffe committed Jan 17, 2016
1 parent 33d8529 commit a44abc3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ double SoapyRTLSDR::getGain(const int direction, const size_t channel, const std
if ((stage_in < 1) || (stage_in > 6))
{
throw std::runtime_error("Invalid IF stage, 1 or 1-6 for E4000");
} else {
stage = stage_in;
}
}
if (tunerType == RTLSDR_TUNER_E4000) {
Expand Down Expand Up @@ -592,7 +594,7 @@ int SoapyRTLSDR::getE4000Gain(int stage, int gain) {
};

static const int8_t if_stage4_gain[] = {
0, 1, 2, 2
0, 1, 2 //, 2
};

static const int8_t if_stage56_gain[] = {
Expand All @@ -610,7 +612,7 @@ int SoapyRTLSDR::getE4000Gain(int stage, int gain) {
n_gains = 4;
} else if (stage == 4) {
if_stage = if_stage4_gain;
n_gains = 4;
n_gains = 3;
} else if (stage == 5 || stage == 6) {
if_stage = if_stage56_gain;
n_gains = 5;
Expand Down

0 comments on commit a44abc3

Please sign in to comment.