hold the lnbp overcurrent detection at static detection until the rotor has
[enigma2.git] / lib / dvb / sec.cpp
index ec2de848a73996aa1b75bce55269280fb85e6a23..749279bccab30b40b597a7fdfa85535f58a23a85 100644 (file)
@@ -460,31 +460,41 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
 
                                        if ( send_mask )
                                        {
+                                               int vlt = iDVBFrontend::voltageOff;
                                                eSecCommand::pair compare;
                                                compare.steps = +3;
                                                compare.tone = iDVBFrontend::toneOff;
                                                sec_sequence.push_back( eSecCommand(eSecCommand::IF_TONE_GOTO, compare) );
                                                sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, iDVBFrontend::toneOff) );
                                                sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_CONT_TONE]) );
-                                               compare.voltage = iDVBFrontend::voltageOff;
-                                               compare.steps = +3;
-                                               // 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 ( RotorCmd != -1 && RotorCmd != lastRotorCmd )
                                                {
                                                        if (rotor_param.m_inputpower_parameters.m_use)
-                                                               compare.voltage = VOLTAGE(18);  // in input power mode set 18V for measure input power
+                                                               vlt = VOLTAGE(18);  // in input power mode set 18V for measure input power
                                                        else
-                                                               compare.voltage = VOLTAGE(13);  // in normal mode start turning with 13V
+                                                               vlt = VOLTAGE(13);  // in normal mode start turning with 13V
                                                }
                                                else
-                                                       compare.voltage = voltage;
+                                                       vlt = voltage;
 
-                                               sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, compare.voltage) );
+                                               // check if voltage is already correct..
+                                               compare.voltage = vlt;
+                                               compare.steps = +7;
+                                               sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) );
+
+                                               // check if voltage is disabled
+                                               compare.voltage = iDVBFrontend::voltageOff;
+                                               compare.steps = +4;
+                                               sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) );
 
-                                                       // voltage was disabled..so we wait a longer time .. for normal switches 250ms should be enough
+                                               // voltage is changed... use DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_SWITCH_CMDS
+                                               sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, vlt) );
+                                               sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_SWITCH_CMDS]) );
+                                               sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +3) );
+
+                                               // voltage was disabled.. use DELAY_AFTER_ENABLE_VOLTAGE_BEFORE_SWITCH_CMDS
+                                               sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, vlt) );
                                                sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_ENABLE_VOLTAGE_BEFORE_SWITCH_CMDS]) );
 
                                                for (int seq_repeat = 0; seq_repeat < (di_param.m_seq_repeat?2:1); ++seq_repeat)
@@ -657,11 +667,10 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::IF_INPUTPOWER_DELTA_GOTO, cmd ) );  // check if rotor has started
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +2 ) );  // timeout .. we assume now the rotor is already at the correct position
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) );  // goto loop start
-                                                       sec_sequence.push_back( eSecCommand(eSecCommand::IF_NO_MORE_ROTOR_DISEQC_RETRYS_GOTO, +10 ) );  // timeout .. we assume now the rotor is already at the correct position
+                                                       sec_sequence.push_back( eSecCommand(eSecCommand::IF_NO_MORE_ROTOR_DISEQC_RETRYS_GOTO, +9 ) );  // timeout .. we assume now the rotor is already at the correct position
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -8) );  // goto loop start
 ////////////////////
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(18)) );
-                                                       sec_sequence.push_back( eSecCommand(eSecCommand::SET_POWER_LIMITING_MODE, eSecCommand::modeDynamic) );
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::SET_TIMEOUT, m_params[MOTOR_RUNNING_TIMEOUT]*20) );  // 2 minutes running timeout
 // rotor running loop
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50) );  // wait 50msec
@@ -669,11 +678,11 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                                                        cmd.direction=0;  // check for stopped rotor
                                                        cmd.steps=+4;
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::IF_INPUTPOWER_DELTA_GOTO, cmd ) );
-                                                       sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +4 ) );  // timeout ? this should never happen
+                                                       sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +3 ) );  // timeout ? this should never happen
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) );  // running loop start
 /////////////////////
-                                                       sec_sequence.push_back( eSecCommand(eSecCommand::SET_POWER_LIMITING_MODE, eSecCommand::modeDynamic) );
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::UPDATE_CURRENT_ROTORPARAMS) );
+                                                       sec_sequence.push_back( eSecCommand(eSecCommand::SET_POWER_LIMITING_MODE, eSecCommand::modeDynamic) );
                                                }
                                                else
                                                {  // use normal turning mode