Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
linuxdvb rotor: Add Min Rotor Move
  • Loading branch information
perexg committed Dec 18, 2014
1 parent c8885ce commit 7a16e29
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/input/mpegts/linuxdvb/linuxdvb_private.h
Expand Up @@ -145,6 +145,7 @@ struct linuxdvb_satconf
*/
int ls_lnb_poweroff;
uint32_t ls_max_rotor_move;
uint32_t ls_min_rotor_move;
double ls_site_lat;
double ls_site_lon;
uint32_t ls_motor_rate;
Expand Down
10 changes: 8 additions & 2 deletions src/input/mpegts/linuxdvb/linuxdvb_rotor.c
Expand Up @@ -294,7 +294,7 @@ linuxdvb_rotor_grace
{
linuxdvb_rotor_t *lr = (linuxdvb_rotor_t*)ld;
linuxdvb_satconf_t *ls = ld->ld_satconf->lse_parent;
int newpos, delta, tunit;
int newpos, delta, tunit, min, res;

if (!ls->ls_last_orbital_pos || ls->ls_motor_rate == 0)
return ls->ls_max_rotor_move;
Expand All @@ -310,7 +310,13 @@ linuxdvb_rotor_grace
return 0;

/* add one extra second, because of the rounding issue */
return ((ls->ls_motor_rate*delta+(tunit-1))/tunit) + 1;
res = ((ls->ls_motor_rate*delta+(tunit-1))/tunit) + 1;

min = 1 + ls->ls_min_rotor_move;
if (res < min)
res = min;

return res;
}

static int
Expand Down
7 changes: 7 additions & 0 deletions src/input/mpegts/linuxdvb/linuxdvb_satconf.c
Expand Up @@ -253,6 +253,13 @@ const idclass_t linuxdvb_satconf_class =
.opts = PO_ADVANCED,
.def.u32 = 120
},
{
.type = PT_U32,
.id = "min_rotor_move",
.name = "Min Rotor Time (seconds)",
.off = offsetof(linuxdvb_satconf_t, ls_min_rotor_move),
.opts = PO_ADVANCED,
},
{
.type = PT_DBL,
.id = "site_lat",
Expand Down

0 comments on commit 7a16e29

Please sign in to comment.