diff options
author | Mark Purcell <msp@debian.org> | 2010-02-25 21:13:46 +1100 |
---|---|---|
committer | etobi <git@e-tobi.net> | 2013-09-03 09:48:46 +0200 |
commit | 665818f1969f893f05edf5b70eb1804c89b2829e (patch) | |
tree | 34ba68cee03c52d769a5a51b456b7e9d63cd091a /lib | |
parent | 109c7947d6a11a2a54eff1b19615ed80ea2f0602 (diff) | |
parent | 9fe4d4ea9c054e539ab679ed2e9c076c35beb69d (diff) | |
download | linux-dvb-apps-665818f1969f893f05edf5b70eb1804c89b2829e.tar.gz |
Imported Debian patch 1.1.1+rev1355-1debian/1.1.1+rev1355-1
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libdvbsec/dvbsec_api.c | 17 |
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; |