From fe24da94d06e4bcfc1130563d9ee0e16a7a3fe46 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 8 May 2014 12:36:56 +0400 Subject: [PATCH] driver/rcinput.cpp: re-add shutdown after wakeup cancel, code from commit af3bd6e922e001266034eb07d34c6394b0c633c4 is lost after some pick ? Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c359fe4eaa5ef4fbef2dcff740533322fd134609 Author: [CST] Focus Date: 2014-05-08 (Thu, 08 May 2014) ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 6 ++++++ src/driver/rcinput.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 0c89de40d..3a5783584 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -145,6 +145,7 @@ CRCInput::CRCInput() repeat_block = repeat_block_generic = 0; open(); rc_last_key = KEY_MAX; + firstKey = true; longPressEnd = 0; //select and setup remote control hardware @@ -1242,6 +1243,11 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 if (ev.type == EV_SYN) continue; /* ignore... */ SHTDCNT::getInstance()->resetSleepTimer(); + if (firstKey) { + firstKey = false; + CTimerManager::getInstance()->cancelShutdownOnWakeup(); + } + uint32_t trkey = translate(ev.code); #ifdef DEBUG printf("%d key: %04x value %d, translate: %04x -%s-\n", ev.value, ev.code, ev.value, trkey, getKeyName(trkey).c_str()); diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index 89f7f4100..f8dc8e906 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -154,6 +154,7 @@ class CRCInput int fd_max; int clickfd; + bool firstKey; __u16 rc_last_key; void set_dsp();