summaryrefslogtreecommitdiff
path: root/rcu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-12-19 18:08:09 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-12-19 18:08:09 +0100
commitc49253824a46a45dac86d2a0404b9d5c6e1a92a4 (patch)
treec81bb3537cd4670d6eddc062d0f0f92a43ade8d2 /rcu.c
parentce8369251cf64919a7f1a8333201d87f92fb2f14 (diff)
downloadvdr-c49253824a46a45dac86d2a0404b9d5c6e1a92a4.tar.gz
vdr-c49253824a46a45dac86d2a0404b9d5c6e1a92a4.tar.bz2
Replaced time_ms() with a threadsafe and non-overflowing cTimeMs
Diffstat (limited to 'rcu.c')
-rw-r--r--rcu.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/rcu.c b/rcu.c
index 71a3220e..4ea80d9e 100644
--- a/rcu.c
+++ b/rcu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: rcu.c 1.7 2004/12/19 17:19:34 kls Exp $
+ * $Id: rcu.c 1.8 2004/12/19 18:06:00 kls Exp $
*/
#include "rcu.h"
@@ -94,7 +94,7 @@ void cRcuRemote::Action(void)
#pragma pack()
time_t LastCodeRefresh = 0;
- int FirstTime = 0;
+ cTimeMs FirstTime;
uint64 LastCommand = 0;
bool repeat = false;
@@ -116,15 +116,14 @@ void cRcuRemote::Action(void)
// This remote control sends the above command before and after
// each keypress - let's just drop this:
break;
- int Now = time_ms();
Command |= uint64(Address) << 32;
if (Command != LastCommand) {
LastCommand = Command;
repeat = false;
- FirstTime = Now;
+ FirstTime.Set();
}
else {
- if (Now - FirstTime < REPEATDELAY)
+ if (FirstTime.Elapsed() < REPEATDELAY)
break; // repeat function kicks in after a short delay
repeat = true;
}