diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2006-06-18 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2006-06-18 18:00:00 +0200 |
commit | 90bc2f18e3fb72bba792226dfd2a6e245464d2f5 (patch) | |
tree | 91c7685580e639523ffd3f79c4993b6b48451e91 /rcu.c | |
parent | 2bb325135433521694b0a387a60225d7727a980e (diff) | |
download | vdr-patch-lnbsharing-90bc2f18e3fb72bba792226dfd2a6e245464d2f5.tar.gz vdr-patch-lnbsharing-90bc2f18e3fb72bba792226dfd2a6e245464d2f5.tar.bz2 |
Version 1.4.1-1vdr-1.4.1-1
- Added "-fPIC" to the compiler options in Make.config.template when compiling
plugins (thanks to Udo Richter). If you use your own Make.config file, you may
want to add these lines there, too.
- Added some comment to cDevice::GetDevice() to explain how the individual
conditions are put together to make a decision on which device to use.
- Updated 'S13E' in 'sources.conf' (thanks to Antti Hartikainen).
- Now making sure VPS timers don't get stuck with outdated events, and that the
actual device isn't used for updating a VPS timer's event as long as other
free devices are available.
- Modified rcu.c to better handle RC5 codes.
- Added a missing variable initialization in cRingBufferLinear::cRingBufferLinear()
(thanks to Prakash Punnoor).
- Fixed handling relative link targets in the ReadLink() function (reported by
Patrick Cernko).
- Now making sure a VPS timer has a schedule in case the epg.data file didn't
contain one when VDR was started.
Diffstat (limited to 'rcu.c')
-rw-r--r-- | rcu.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: rcu.c 1.13 2006/01/08 11:40:09 kls Exp $ + * $Id: rcu.c 1.14 2006/06/16 09:29:24 kls Exp $ */ #include "rcu.h" @@ -13,8 +13,9 @@ #include <unistd.h> #include "tools.h" -#define REPEATLIMIT 20 // ms -#define REPEATDELAY 350 // ms +#define REPEATLIMIT 150 // ms +#define REPEATDELAY 350 // ms +#define HANDSHAKETIMEOUT 20 // ms cRcuRemote::cRcuRemote(const char *DeviceName) :cRemote("RCU") @@ -96,7 +97,7 @@ void cRcuRemote::Action(void) time_t LastCodeRefresh = 0; cTimeMs FirstTime; unsigned char LastCode = 0, LastMode = 0; - uint64 LastCommand = 0; + uint64 LastCommand = ~0; // 0x00 might be a valid command unsigned int LastData = 0; bool repeat = false; @@ -136,7 +137,7 @@ void cRcuRemote::Action(void) else if (repeat) { // the last one was a repeat, so let's generate a release Put(LastCommand, false, true); repeat = false; - LastCommand = 0; + LastCommand = ~0; } else { unsigned int d = data; @@ -154,9 +155,9 @@ void cRcuRemote::Action(void) SendCommand(m); LastMode = m; } - LastCommand = 0; + LastCommand = ~0; } - if (code && time(NULL) - LastCodeRefresh > 60) { + if (!repeat && code && time(NULL) - LastCodeRefresh > 60) { SendCommand(code); // in case the PIC listens to the wrong code LastCodeRefresh = time(NULL); } @@ -181,7 +182,7 @@ bool cRcuRemote::SendByteHandshake(unsigned char c) if (f >= 0) { int w = write(f, &c, 1); if (w == 1) { - for (int reply = ReceiveByte(REPEATLIMIT); reply >= 0;) { + for (int reply = ReceiveByte(HANDSHAKETIMEOUT); reply >= 0;) { if (reply == c) return true; else if (reply == 'X') { |