1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

use svalue instead if uvalue for signed values

This commit is contained in:
Ralph Metzler 2018-02-12 22:47:31 +01:00
parent ae9644d934
commit 991393950b
3 changed files with 8 additions and 8 deletions

View File

@ -1669,12 +1669,12 @@ static int get_stats(struct dvb_frontend *fe)
str -= 108750;
p->strength.len = 1;
p->strength.stat[0].scale = FE_SCALE_DECIBEL;
p->strength.stat[0].uvalue = str;
p->strength.stat[0].svalue = str;
read_snr(fe, &val);
p->cnr.len = 1;
p->cnr.stat[0].scale = FE_SCALE_DECIBEL;
p->cnr.stat[0].uvalue = 100 * (s64) (s16) val;
p->cnr.stat[0].svalue = 100 * (s64) (s16) val;
return 0;
}
@ -2179,7 +2179,7 @@ static int read_snr(struct dvb_frontend *fe, u16 *snr)
*snr = SNR;
p->cnr.len = 1;
p->cnr.stat[0].scale = FE_SCALE_DECIBEL;
p->cnr.stat[0].uvalue = 10 * (s64) SNR;
p->cnr.stat[0].svalue = 10 * (s64) SNR;
return 0;
}

View File

@ -648,7 +648,7 @@ static int read_snr(struct dvb_frontend *fe, u16 *snr)
*snr = (s16) (regData & 0xFFFF); /* 100x dB */
p->cnr.len = 1;
p->cnr.stat[0].scale = FE_SCALE_DECIBEL;
p->cnr.stat[0].uvalue = 10 * (s64) *snr;
p->cnr.stat[0].svalue = 10 * (s64) *snr;
return stat;
}
@ -725,7 +725,7 @@ static int read_signal_strength(struct dvb_frontend *fe, u16 *strength)
*strength = (u16) (regData & 0xFFFF); /* 10x dBm */
p->strength.len = 1;
p->strength.stat[0].scale = FE_SCALE_DECIBEL;
p->strength.stat[0].uvalue = 10 * (s64) (s16) (regData & 0xFFFF);
p->strength.stat[0].svalue = 10 * (s64) (s16) (regData & 0xFFFF);
return stat;
}

View File

@ -1670,7 +1670,7 @@ static int read_snr(struct dvb_frontend *fe, u16 *snr)
*snr = snr32;
p->cnr.len = 1;
p->cnr.stat[0].scale = FE_SCALE_DECIBEL;
p->cnr.stat[0].uvalue = 100 * (s64)snr32;
p->cnr.stat[0].svalue = 100 * (s64)snr32;
return 0;
}
@ -1775,9 +1775,9 @@ static int read_signal_strength(struct dvb_frontend *fe, u16 *strength)
p->strength.len = 1;
p->strength.stat[0].scale = FE_SCALE_DECIBEL;
p->strength.stat[0].uvalue = 10 * (s64)(s16)*strength - 108750;
p->strength.stat[0].svalue = 10 * (s64)(s16)*strength - 108750;
/* *strength is in hundredth dBuv, uvalue is in thousandth dBm */
/* *strength is in hundredth dBuv, svalue is in thousandth dBm */
return 0;
}