aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libdvbsec/dvbsec_api.c
diff options
context:
space:
mode:
authorMark Purcell <msp@debian.org>2010-02-25 21:13:46 +1100
committeretobi <git@e-tobi.net>2013-09-03 09:48:46 +0200
commit665818f1969f893f05edf5b70eb1804c89b2829e (patch)
tree34ba68cee03c52d769a5a51b456b7e9d63cd091a /lib/libdvbsec/dvbsec_api.c
parent109c7947d6a11a2a54eff1b19615ed80ea2f0602 (diff)
parent9fe4d4ea9c054e539ab679ed2e9c076c35beb69d (diff)
downloadlinux-dvb-apps-3a4100597b16fb9c0845fab3a54b14f0af8aa62b.tar.gz
Imported Debian patch 1.1.1+rev1355-1debian/1.1.1+rev1355-1
Diffstat (limited to 'lib/libdvbsec/dvbsec_api.c')
-rw-r--r--lib/libdvbsec/dvbsec_api.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/libdvbsec/dvbsec_api.c b/lib/libdvbsec/dvbsec_api.c
index 5f2ae22..62d225e 100644
--- a/lib/libdvbsec/dvbsec_api.c
+++ b/lib/libdvbsec/dvbsec_api.c
@@ -537,19 +537,12 @@ int dvbsec_diseqc_goto_rotator_bearing(struct dvbfe_handle *fe,
}
// generate the command
- if (integer < -256) {
- return -EINVAL;
- } else if (integer < 0) {
- integer = -integer;
- data[3] = 0xf0;
- } else if (integer < 256) {
- data[3] = 0x00;
- } else if (integer < 512) {
- integer -= 256;
- data[3] = 0x10;
- } else {
- return -EINVAL;
+ if (integer < 0.0) {
+ data[3] = 0xD0; // West is a negative angle value
+ } else if (integer >= 0.0) {
+ data[3] = 0xE0; // East is a positive angle value
}
+ integer = abs(integer);
data[3] |= ((integer / 16) & 0x0f);
integer = integer % 16;
data[4] |= ((integer & 0x0f) << 4) | fraction;