1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Improved LIRC timing for repeat function

This commit is contained in:
Klaus Schmidinger 2013-01-30 13:03:00 +01:00
parent 7fa0d338eb
commit d95804fec3
2 changed files with 9 additions and 8 deletions

View File

@ -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 avoid a black screen while such a message is displayed in case the channel will be
switched (reported by Uwe Scheffler). switched (reported by Uwe Scheffler).
- Updated the Slovakian language texts (thanks to Milan Hrala). - Updated the Slovakian language texts (thanks to Milan Hrala).
- Improved LIRC timing for repeat function.

16
lirc.c
View File

@ -6,16 +6,16 @@
* *
* LIRC support added by Carsten Koch <Carsten.Koch@icem.de> 2000-06-16. * LIRC support added by Carsten Koch <Carsten.Koch@icem.de> 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 "lirc.h"
#include <netinet/in.h> #include <netinet/in.h>
#include <sys/socket.h> #include <sys/socket.h>
#define REPEATDELAY 350 // ms #define REPEATDELAY 300 // ms
#define REPEATFREQ 100 // ms #define REPEATFREQ 100 // ms
#define REPEATTIMEOUT 500 // ms #define REPEATTIMEOUT 150 // ms
#define RECONNECTDELAY 3000 // ms #define RECONNECTDELAY 3000 // ms
cLircRemote::cLircRemote(const char *DeviceName) cLircRemote::cLircRemote(const char *DeviceName)
@ -104,13 +104,13 @@ void cLircRemote::Action(void)
FirstTime.Set(); FirstTime.Set();
timeout = -1; 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 { 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; repeat = true;
timeout = REPEATDELAY; timeout = REPEATTIMEOUT;
} }
LastTime.Set(); LastTime.Set();
Put(KeyName, repeat); Put(KeyName, repeat);