diff options
author | etobi <git@e-tobi.net> | 2013-09-03 09:48:45 +0200 |
---|---|---|
committer | etobi <git@e-tobi.net> | 2013-09-03 09:48:45 +0200 |
commit | 9fe4d4ea9c054e539ab679ed2e9c076c35beb69d (patch) | |
tree | affff927f15c8ae6c77890cc9564855efe2e51db /lib/libdvbsec/dvbsec_api.c | |
parent | 9a5228e0f2b898367b7943d294be58caf6ce8bb3 (diff) | |
download | linux-dvb-apps-9fe4d4ea9c054e539ab679ed2e9c076c35beb69d.tar.gz |
Imported Upstream version 1.1.1+rev1355upstream/1.1.1+rev1355
Diffstat (limited to 'lib/libdvbsec/dvbsec_api.c')
-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; |