From 6d3a2fea6e111f80b5e3616bf6eb0cb22ea37185 Mon Sep 17 00:00:00 2001 From: Sam Stenvall Date: Tue, 25 Jun 2024 15:05:20 +0300 Subject: [PATCH] Move setup_switch() call to axe_wakup instead of axe_get_signal --- src/axe.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/axe.c b/src/axe.c index a599264c06..6aa6237a6e 100644 --- a/src/axe.c +++ b/src/axe.c @@ -234,9 +234,15 @@ int axe_wakeup(adapter *_ad, int fe_fd, int voltage) { if (ad == NULL || is_adapter_disabled(i)) continue; LOG("axe_wakeup: waking adapter %d, fd %d", i, ad->fe2); - if (ioctl(ad->fe2, FE_SET_VOLTAGE, voltage) == -1) - LOG("axe_wakeup: FE_SET_VOLTAGE failed fd %d: %s", ad->fe2, - strerror(errno)); + + if (ad->tp.diseqc_param.switch_type == SWITCH_JESS || + ad->tp.diseqc_param.switch_type == SWITCH_UNICABLE) { + axe_setup_switch(ad); + } else { + if (ioctl(ad->fe2, FE_SET_VOLTAGE, voltage) == -1) + LOG("axe_wakeup: FE_SET_VOLTAGE failed fd %d: %s", ad->fe2, + strerror(errno)); + } } return 0; } @@ -722,13 +728,6 @@ int axe_get_signal(adapter *ad) { ad->strength = strength; ad->status = status; ad->ber = ber; - - if (ad->status == 0 && - ((ad->tp.diseqc_param.switch_type == SWITCH_JESS) || - (ad->tp.diseqc_param.switch_type == SWITCH_UNICABLE))) { - axe_setup_switch(ad); - } - adapter_unlock(ad->id); return 0; }