diff --git a/HISTORY b/HISTORY index 853a340e..012ea082 100644 --- a/HISTORY +++ b/HISTORY @@ -7557,3 +7557,4 @@ Video Disk Recorder Revision History avoid a black screen while such a message is displayed in case the channel will be switched (reported by Uwe Scheffler). - Updated the Slovakian language texts (thanks to Milan Hrala). +- Improved LIRC timing for repeat function. diff --git a/lirc.c b/lirc.c index e3b68db9..67b955c5 100644 --- a/lirc.c +++ b/lirc.c @@ -6,16 +6,16 @@ * * LIRC support added by Carsten Koch 2000-06-16. * - * $Id: lirc.c 2.1 2011/03/08 15:35:13 kls Exp $ + * $Id: lirc.c 2.2 2013/01/30 11:56:38 kls Exp $ */ #include "lirc.h" #include #include -#define REPEATDELAY 350 // ms +#define REPEATDELAY 300 // ms #define REPEATFREQ 100 // ms -#define REPEATTIMEOUT 500 // ms +#define REPEATTIMEOUT 150 // ms #define RECONNECTDELAY 3000 // ms cLircRemote::cLircRemote(const char *DeviceName) @@ -104,13 +104,13 @@ void cLircRemote::Action(void) FirstTime.Set(); timeout = -1; } + else if (FirstTime.Elapsed() < REPEATDELAY) + continue; // repeat function kicks in after a short delay + else if (LastTime.Elapsed() < REPEATFREQ) + continue; // skip same keys coming in too fast else { - if (LastTime.Elapsed() < REPEATFREQ) - continue; // repeat function kicks in after a short delay (after last key instead of first key) - if (FirstTime.Elapsed() < REPEATDELAY) - continue; // skip keys coming in too fast (for count != 0 as well) repeat = true; - timeout = REPEATDELAY; + timeout = REPEATTIMEOUT; } LastTime.Set(); Put(KeyName, repeat);