diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-05-26 10:44:00 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-05-26 10:44:00 +0000 |
| commit | a4cadca93a60d5a5019d2a063e39d66f50e576e2 (patch) | |
| tree | ee2c846e02376410dda622d93482f3a3a72b074b /lib/dvb | |
| parent | 9b843d26103fef93110a107d0bf0e60dea9064d0 (diff) | |
| download | enigma2-a4cadca93a60d5a5019d2a063e39d66f50e576e2.tar.gz enigma2-a4cadca93a60d5a5019d2a063e39d66f50e576e2.zip | |
fix one step east / one step west option
add ability to (re)enable rotor limits
add ability to turn rotor to reference position (goto 0)
Diffstat (limited to 'lib/dvb')
| -rw-r--r-- | lib/dvb/frontend.cpp | 7 | ||||
| -rw-r--r-- | lib/dvb/frontend.h | 3 | ||||
| -rw-r--r-- | lib/dvb/sec.cpp | 45 |
3 files changed, 34 insertions, 21 deletions
diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index b85fbc29..220d3e87 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -91,6 +91,7 @@ void eDVBDiseqcCommand::setCommandString(const char *str) eDebug("invalid diseqc command string length (string is to long)"); return; } + eDebugNoNewLine("send diseqc:"); unsigned char val=0; for (int i=0; i < slen; ++i) { @@ -107,11 +108,13 @@ void eDVBDiseqcCommand::setCommandString(const char *str) if ( i % 2 ) { val |= c; + eDebugNoNewLine("%02x", val); data[i/2] = val; } else val = c << 4; } + eDebug(""); len = slen/2; } @@ -543,12 +546,16 @@ void eDVBFrontend::feEvent(int w) #endif { state = stateLock; + m_data[CSW] = m_data[NEW_CSW]; + m_data[UCSW] = m_data[NEW_UCSW]; + m_data[TONEBURST] = m_data[NEW_TONEBURST]; } else { if (m_tuning) state = stateTuning; else { + eDebug("stateLostLock"); state = stateLostLock; m_data[CSW] = m_data[UCSW] = m_data[TONEBURST] = -1; // reset diseqc } diff --git a/lib/dvb/frontend.h b/lib/dvb/frontend.h index 3670ceb8..abc28d92 100644 --- a/lib/dvb/frontend.h +++ b/lib/dvb/frontend.h @@ -58,6 +58,9 @@ class eDVBFrontend: public iDVBFrontend, public Object eSecCommandList m_sec_sequence; enum { + NEW_CSW, // new committed switch cmd + NEW_UCSW, // new uncommitted switch cmd + NEW_TONEBURST, // new toneburst switch cmd CSW, // state of the committed switch UCSW, // state of the uncommitted switch TONEBURST, // current state of toneburst switch diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp index 70c742a2..e0bf5fd3 100644 --- a/lib/dvb/sec.cpp +++ b/lib/dvb/sec.cpp @@ -544,8 +544,8 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) ); compare.steps = +3; sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, compare.voltage) ); - // voltage was disabled..so we wait a longer time .. for normal switches 200ms should be enough - sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 200) ); + // voltage was disabled..so we wait a longer time .. for normal switches 500ms should be enough + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 750) ); for (int seq_repeat = 0; seq_repeat < (di_param.m_seq_repeat?2:1); ++seq_repeat) { @@ -627,25 +627,28 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA if ( RotorCmd != -1 && RotorCmd != lastRotorCmd ) { eSecCommand::pair compare; - compare.voltage = iDVBFrontend::voltageOff; - compare.steps = +4; - // the next is a check if voltage is switched off.. then we first set a voltage :) - // else we set voltage after all diseqc stuff.. - sec_sequence.push_back( eSecCommand(eSecCommand::IF_NOT_VOLTAGE_GOTO, compare) ); - - if (rotor_param.m_inputpower_parameters.m_use) - sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(13)) ); // in normal mode start turning with 13V - else - sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(18)) ); // turn always with 18V + if (!send_mask) + { + compare.voltage = iDVBFrontend::voltageOff; + compare.steps = +4; + // the next is a check if voltage is switched off.. then we first set a voltage :) + // else we set voltage after all diseqc stuff.. + sec_sequence.push_back( eSecCommand(eSecCommand::IF_NOT_VOLTAGE_GOTO, compare) ); - // voltage was disabled..so we wait a longer time .. - sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 500) ); - sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +7) ); // no need to send stop rotor cmd + if (rotor_param.m_inputpower_parameters.m_use) + sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(13)) ); // in normal mode start turning with 13V + else + sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(18)) ); // turn always with 18V - if (send_mask) - sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 750) ); // wait 750ms after send switch cmd + // voltage was disabled..so we wait a longer time .. + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 750) ); + sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +8) ); // no need to send stop rotor cmd and recheck voltage + } else - sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +1) ); + { + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 750) ); // wait 750ms after send switch cmd + sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +8) ); // no need to send stop rotor cmd and recheck voltage + } eDVBDiseqcCommand diseqc; diseqc.len = 3; @@ -771,9 +774,9 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA else csw = band; - frontend.setData(eDVBFrontend::CSW, csw); - frontend.setData(eDVBFrontend::UCSW, ucsw); - frontend.setData(eDVBFrontend::TONEBURST, di_param.m_toneburst_param); + frontend.setData(eDVBFrontend::NEW_CSW, csw); + frontend.setData(eDVBFrontend::NEW_UCSW, ucsw); + frontend.setData(eDVBFrontend::NEW_TONEBURST, di_param.m_toneburst_param); if (!linked && doSetVoltageToneFrontend) { |
