linuxdvb rotor: Add Min Rotor Move

This commit is contained in:
Jaroslav Kysela 2014-12-18 09:04:46 +01:00
parent c8885ce5cb
commit 7a16e29293
3 changed files with 16 additions and 2 deletions

View file

@ -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;

View file

@ -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;
@ -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

View file

@ -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",