Skip to content

Commit

Permalink
JESS: patch #19, by adenin, "[unicable] cleanup's and correction of f…
Browse files Browse the repository at this point in the history
…requency that was sometimes displayed incorrectly in tuner status"

Some parts are left out, as they refer to parts in #19 not included.

Cherry-picked from: Huevos/enigma2@2987154
  • Loading branch information
eriksl committed Aug 5, 2016
1 parent c67a668 commit 6f26d08
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/dvb/frontend.cpp
Expand Up @@ -1923,7 +1923,7 @@ void eDVBFrontend::setFrontend(bool recvEvents)
{
int type = -1;
oparm.getSystem(type);
eDebug("[eDVBFrontend] setting frontend %d", m_dvbid);
eDebug("[eDVBFrontend] setting frontend %d events: %s", m_dvbid, recvEvents?"on":"off");
if (recvEvents)
m_sn->start();
feEvent(-1); // flush events
Expand Down
1 change: 0 additions & 1 deletion lib/dvb/frontend.h
Expand Up @@ -81,7 +81,6 @@ class eDVBFrontend: public iDVBFrontend, public Object
TAKEOVER_MASTER,
TAKEOVER_SLAVE,
TAKEOVER_RELEASE,
GUARD_IDX,
NUM_DATA_ENTRIES
};
Signal1<void,iDVBFrontend*> m_stateChanged;
Expand Down
29 changes: 17 additions & 12 deletions lib/dvb/sec.cpp
Expand Up @@ -411,8 +411,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, const eDVB
lastToneburst = -1,
lastRotorCmd = -1,
curRotorPos = -1,
satposDependPtr = -1,
guard_idx = 0;
satposDependPtr = -1;
iDVBFrontend *sec_fe=&frontend;
eDVBRegisteredFrontend *linked_fe = 0;
eDVBSatelliteDiseqcParameters::t_diseqc_mode diseqc_mode = di_param.m_diseqc_mode;
Expand Down Expand Up @@ -516,14 +515,8 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, const eDVB
long curr_lof;
long curr_band;

frontend.getData(eDVBFrontend::GUARD_IDX, guard_idx);
frontend.getData(eDVBFrontend::CUR_FREQ, curr_frq);
frontend.getData(eDVBFrontend::CUR_SYM, curr_sym);
if ((curr_frq > 0) && ((abs(sat.symbol_rate - curr_sym) < 2000) && (sat.frequency != curr_frq)))
guard_idx++;
if ((guard_idx < 0) || (guard_idx >= (sizeof(lnb_param.guard_frq) / sizeof(lnb_param.guard_frq[0]))))
guard_idx = 0;
frontend.setData(eDVBFrontend::GUARD_IDX, guard_idx);
frontend.getData(eDVBFrontend::CUR_LOF, curr_lof);
frontend.getData(eDVBFrontend::CUR_BAND, curr_band);

Expand All @@ -537,17 +530,29 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, const eDVB
case 1: // JESS
{
eDebugNoSimulate("[%s] JESS", __func__);
frontend.setData(eDVBFrontend::FREQ_OFFSET, lof + prepareOffsetForJESS(frontend, lnb_param, band, ifreq, frequency, lnb_param.TuningWord, guard_freq));
if(gfrq)
{
long inv;
frontend.getData(eDVBFrontend::SPECTINV_CNT, inv);
prepareOffsetForJESS(frontend, lnb_param, curr_band, gfrq, frequency, lnb_param.GuardTuningWord, 0);
frontend.setData(eDVBFrontend::SPECTINV_CNT, inv);
}
frontend.setData(eDVBFrontend::FREQ_OFFSET, lof + prepareOffsetForJESS(frontend, lnb_param, band, ifreq, frequency, lnb_param.TuningWord, 0));

break;
}

default: // Unicable or other?
{
eDebugNoSimulate("[%s] Unicable", __func__);
frontend.setData(eDVBFrontend::FREQ_OFFSET, lof + prepareOffsetForUnicable(frontend, lnb_param, band, ifreq, frequency, lnb_param.TuningWord, guard_freq));

break;
if(gfrq)
{
long inv;
frontend.getData(eDVBFrontend::SPECTINV_CNT, inv);
prepareOffsetForUnicable(frontend, lnb_param, curr_band, gfrq, frequency, lnb_param.GuardTuningWord, 0);
frontend.setData(eDVBFrontend::SPECTINV_CNT, inv);
}
frontend.setData(eDVBFrontend::FREQ_OFFSET, lof + prepareOffsetForUnicable(frontend, lnb_param, band, ifreq, frequency, lnb_param.TuningWord, 0));
}
}
voltage = VOLTAGE(13);
Expand Down

0 comments on commit 6f26d08

Please sign in to comment.