EN50494: replace hardcoded en50494 tune-freq with calculated one
This commit is contained in:
parent
66c6d85f39
commit
229ef2f48e
3 changed files with 34 additions and 16 deletions
|
@ -57,20 +57,19 @@
|
|||
* Class definition
|
||||
* *************************************************************************/
|
||||
|
||||
typedef struct linuxdvb_en50494
|
||||
{
|
||||
linuxdvb_diseqc_t;
|
||||
|
||||
/* en50494 configuration*/
|
||||
uint8_t le_position; /* satelitte A(0) or B(1) */
|
||||
uint16_t le_frequency; /* user band frequency in MHz */
|
||||
uint8_t le_id; /* user band id 0-7 */
|
||||
uint16_t le_pin; /* 0-255 or LINUXDVB_EN50494_NOPIN */
|
||||
|
||||
/* runtime */
|
||||
uint32_t (*lnb_freq)(linuxdvb_lnb_t*, linuxdvb_mux_t*);
|
||||
|
||||
} linuxdvb_en50494_t;
|
||||
//typedef struct linuxdvb_en50494
|
||||
//{
|
||||
// linuxdvb_diseqc_t;
|
||||
//
|
||||
// /* en50494 configuration*/
|
||||
// uint8_t le_position; /* satelitte A(0) or B(1) */
|
||||
// uint16_t le_frequency; /* user band frequency in MHz */
|
||||
// uint8_t le_id; /* user band id 0-7 */
|
||||
// uint16_t le_pin; /* 0-255 or LINUXDVB_EN50494_NOPIN */
|
||||
//
|
||||
// /* runtime */
|
||||
// uint32_t le_tune_freq; /* the real frequency to tune to */
|
||||
//} linuxdvb_en50494_t;
|
||||
|
||||
static const char *
|
||||
linuxdvb_en50494_class_get_title ( idnode_t *o )
|
||||
|
@ -177,7 +176,7 @@ linuxdvb_en50494_tune
|
|||
tvhlog(LOG_ERR, LINUXDVB_EN50494_NAME, "transponder value bigger then 1024");
|
||||
return -1;
|
||||
}
|
||||
// uint32_t tunefreq = (t + 350) * 4000 - freq; /* real used en50494 frequency */
|
||||
le->le_tune_freq = (t + 350) * 4000 - freq; /* real used en50494 frequency */
|
||||
|
||||
/* 2 data fields (16bit) */
|
||||
uint8_t data1, data2;
|
||||
|
|
|
@ -35,6 +35,7 @@ typedef struct linuxdvb_diseqc linuxdvb_diseqc_t;
|
|||
typedef struct linuxdvb_lnb linuxdvb_lnb_t;
|
||||
typedef struct linuxdvb_network linuxdvb_network_t;
|
||||
typedef struct linuxdvb_mux linuxdvb_mux_t;
|
||||
typedef struct linuxdvb_en50494 linuxdvb_en50494_t;
|
||||
|
||||
typedef LIST_HEAD(,linuxdvb_hardware) linuxdvb_hardware_list_t;
|
||||
typedef TAILQ_HEAD(linuxdvb_satconf_ele_list,linuxdvb_satconf_ele) linuxdvb_satconf_ele_list_t;
|
||||
|
@ -220,6 +221,20 @@ struct linuxdvb_lnb
|
|||
int (*lnb_pol) (linuxdvb_lnb_t*, linuxdvb_mux_t*);
|
||||
};
|
||||
|
||||
struct linuxdvb_en50494
|
||||
{
|
||||
linuxdvb_diseqc_t;
|
||||
|
||||
/* en50494 configuration*/
|
||||
uint8_t le_position; /* satelitte A(0) or B(1) */
|
||||
uint16_t le_frequency; /* user band frequency in MHz */
|
||||
uint8_t le_id; /* user band id 0-7 */
|
||||
uint16_t le_pin; /* 0-255 or LINUXDVB_EN50494_NOPIN */
|
||||
|
||||
/* runtime */
|
||||
uint32_t le_tune_freq; /* the real frequency to tune to */
|
||||
};
|
||||
|
||||
/*
|
||||
* Methods
|
||||
*/
|
||||
|
|
|
@ -868,7 +868,11 @@ linuxdvb_satconf_ele_tune ( linuxdvb_satconf_ele_t *lse )
|
|||
|
||||
/* Frontend */
|
||||
// TODO: get en50494 tuning frequency, not channel frequency
|
||||
f = 2040500;// lse->ls_lnb->lnb_freq(lse->ls_lnb, lm);
|
||||
if (lse->ls_en50494) {
|
||||
f = ((linuxdvb_en50494_t*)lse->ls_en50494)->le_tune_freq;
|
||||
} else {
|
||||
f = lse->ls_lnb->lnb_freq(lse->ls_lnb, lm);
|
||||
}
|
||||
return linuxdvb_frontend_tune1(lfe, mmi, f);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue