zapit/src/frontend.cpp: fix slave flag in CFrontend::sendEN50494TuningCommand

This commit is contained in:
[CST] Focus
2012-05-14 15:06:09 +04:00
parent 81115c7235
commit 11d2b24f48

View File

@@ -1054,8 +1054,6 @@ void CFrontend::setInput(t_satellite_position satellitePosition, uint32_t freque
uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int high_band,
const int horizontal, const int bank)
{
if (slave || info.type != FE_QPSK)
return;
uint32_t uni_qrgs[] = { 1284, 1400, 1516, 1632, 1748, 1864, 1980, 2096 };
uint32_t bpf;
if (config.uni_qrg == 0)
@@ -1069,7 +1067,8 @@ uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int
unsigned int t = (frequency / 1000 + bpf + 2) / 4 - 350;
if (t < 1024 && config.uni_scr >= 0 && config.uni_scr < 8)
{
fprintf(stderr, "VOLT18=%d TONE_ON=%d, freq=%d bpf=%d ret=%d\n", currentVoltage == SEC_VOLTAGE_18, currentToneMode == SEC_TONE_ON, frequency, bpf, (t + 350) * 4000 - frequency);
INFO("VOLT18=%d TONE_ON=%d, freq=%d bpf=%d ret=%d", currentVoltage == SEC_VOLTAGE_18, currentToneMode == SEC_TONE_ON, frequency, bpf, (t + 350) * 4000 - frequency);
if (!slave && info.type == FE_QPSK) {
cmd.msg[3] = (t >> 8) | /* highest 3 bits of t */
(config.uni_scr << 5) | /* adress */
(bank << 4) | /* not implemented yet */
@@ -1080,6 +1079,7 @@ uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int
usleep(15 * 1000); /* en50494 says: >4ms and < 22 ms */
sendDiseqcCommand(&cmd, 50); /* en50494 says: >2ms and < 60 ms */
fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13);
}
return (t + 350) * 4000 - frequency;
}
WARN("ooops. t > 1024? (%d) or uni_scr out of range? (%d)", t, config.uni_scr);