From fb40b87e2c0a7d0bf5fdae7dab085843fe96fffe Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 23 Oct 2015 21:26:12 +0200 Subject: [PATCH] linuxdvb: satconf - even more udelay fixes (rotor/switch) - keep everything consistent --- src/input/mpegts/linuxdvb/linuxdvb_rotor.c | 6 +++--- src/input/mpegts/linuxdvb/linuxdvb_satconf.c | 5 +++-- src/input/mpegts/linuxdvb/linuxdvb_switch.c | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/input/mpegts/linuxdvb/linuxdvb_rotor.c b/src/input/mpegts/linuxdvb/linuxdvb_rotor.c index f0ea50108..be4fe06d9 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_rotor.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_rotor.c @@ -95,7 +95,7 @@ const idclass_t linuxdvb_rotor_class = { { .type = PT_U32, .id = "powerup_time", - .name = N_("Powerup Time (ms) (0-200)"), + .name = N_("Powerup Time (ms) (15-200)"), .off = offsetof(linuxdvb_rotor_t, lr_powerup_time), .def.u32 = 100, }, @@ -430,7 +430,7 @@ linuxdvb_rotor_tune return 0; /* Force to 18v (quicker movement) */ - if (linuxdvb_satconf_start(lsp, MINMAX(lr->lr_powerup_time, 0, 200), 1)) + if (linuxdvb_satconf_start(lsp, MINMAX(lr->lr_powerup_time, 15, 200), 1)) return -1; /* GotoX */ @@ -501,7 +501,7 @@ linuxdvb_rotor_create0 } lr = (linuxdvb_rotor_t *)ld; if (lr->lr_powerup_time == 0) - lr->lr_powerup_time = 85; + lr->lr_powerup_time = 100; if (lr->lr_cmd_time == 0) lr->lr_cmd_time = 25; } diff --git a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c index 7a4a17c8c..cd457d45e 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c @@ -712,9 +712,10 @@ linuxdvb_satconf_start ( linuxdvb_satconf_t *ls, int delay, int vol ) } ls->ls_last_tone_off = 1; } - if (delay) { + /* the linuxdvb_diseqc_set_volt() fcn already sleeps for 15ms */ + if (delay > 15) { tvhtrace("diseqc", "initial sleep %dms", delay); - usleep(delay*1000); + usleep((delay-15)*1000); } return 0; } diff --git a/src/input/mpegts/linuxdvb/linuxdvb_switch.c b/src/input/mpegts/linuxdvb/linuxdvb_switch.c index 0843997af..4157c37db 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_switch.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_switch.c @@ -146,7 +146,7 @@ const idclass_t linuxdvb_switch_class = { .type = PT_U32, .id = "poweruptime", - .name = N_("Powerup Time (ms) (0-200)"), + .name = N_("Powerup Time (ms) (15-200)"), .off = offsetof(linuxdvb_switch_t, ls_powerup_time), .def.u32 = 100, }, @@ -181,7 +181,7 @@ linuxdvb_switch_tune lsp->ls_last_switch = NULL; - if (linuxdvb_satconf_start(lsp, MINMAX(ls->ls_powerup_time, 0, 200), pol)) + if (linuxdvb_satconf_start(lsp, MINMAX(ls->ls_powerup_time, 15, 200), pol)) return -1; com = 0xF0 | (ls->ls_committed << 2) | (pol << 1) | band; @@ -232,7 +232,7 @@ linuxdvb_switch_tune if (ls->ls_toneburst >= 0 && (lsp->ls_diseqc_full || lsp->ls_last_toneburst != ls->ls_toneburst + 1)) { - if (linuxdvb_satconf_start(lsp, MINMAX(ls->ls_powerup_time, 0, 200), vol)) + if (linuxdvb_satconf_start(lsp, MINMAX(ls->ls_powerup_time, 15, 200), vol)) return -1; lsp->ls_last_toneburst = 0; @@ -282,7 +282,7 @@ linuxdvb_switch_create0 ld->ls_uncommitted = u; } if (ld->ls_powerup_time == 0) - ld->ls_powerup_time = 85; + ld->ls_powerup_time = 100; if (ld->ls_sleep_time == 0) ld->ls_sleep_time = 25; } -- 2.47.3