Testing timer wakeup fixes for NEO

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@741 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: 08a941af26
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2010-09-01 (Wed, 01 Sep 2010)



------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2010-09-01 17:39:39 +00:00
parent 01372ed6a9
commit f45f49a142
2 changed files with 34 additions and 18 deletions

View File

@@ -3746,25 +3746,28 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
struct tm *tmtime = localtime(&mtime); struct tm *tmtime = localtime(&mtime);
time_t fp_timer = 0; time_t fp_timer = 0;
if(timer_minutes) if(timer_minutes) {
fp_timer = (timer_minutes - mtime)/60; fp_timer = timer_minutes - mtime/60;
printf("now: %ld, timer %ld, FP timer %ld\n", mtime/60, timer_minutes/60, fp_timer);fflush(stdout); if(fp_timer < 1)
fp_timer = 1;
}
printf("now: %ld, timer %ld, FP timer %ldmin\n", mtime/60, timer_minutes, fp_timer);fflush(stdout);
int leds = 0x40; int leds = 0x40;
switch(g_settings.led_deep_mode){ switch(g_settings.led_deep_mode){
case 0: case 0:
leds = 0x0;//off leds leds = 0x0;//off leds
break; break;
case 1: case 1:
leds = 0x60;//on led1 & 2 leds = 0x60;//on led1 & 2
break; break;
case 2: case 2:
leds = 0x20;//led1 on , 2 off leds = 0x20;//led1 on , 2 off
break; break;
case 3: case 3:
leds = 0x40;//led2 off, 2 on leds = 0x40;//led2 off, 2 on
break; break;
default: default:
break; break;
} }
standby.brightness = g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS]; standby.brightness = g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS];

View File

@@ -35,6 +35,7 @@
#include <timerdclient/timerdmsg.h> #include <timerdclient/timerdmsg.h>
#include <debug.h> #include <debug.h>
#include <sectionsdclient/sectionsdclient.h> #include <sectionsdclient/sectionsdclient.h>
#include <coolstream/cs_vfd.h>
#include <vector> #include <vector>
@@ -62,7 +63,19 @@ void CTimerManager::Init(void)
m_saveEvents = false; m_saveEvents = false;
m_isTimeSet = false; m_isTimeSet = false;
wakeup = 0; wakeup = 0;
printf("[timerd] wakeup from standby: %s\n", wakeup ? "yes" : "no");
int fd = open("/dev/display", O_RDONLY);
if (fd < 0) {
perror("/dev/display");
} else {
wakeup_data_t wk;
memset(&wk, 0, sizeof(wk));
int ret = ioctl(fd, IOC_VFD_GET_WAKEUP, &wk);
if(ret >= 0)
wakeup = ((wk.source == WAKEUP_SOURCE_TIMER) /* || (wk.source == WAKEUP_SOURCE_PWLOST)*/);
}
printf("[timerd] wakeup from standby: %s\n", wakeup ? "yes" : "no");
if(wakeup) if(wakeup)
creat("/tmp/.wakeup", 0); creat("/tmp/.wakeup", 0);
@@ -664,7 +677,7 @@ void CTimerManager::saveEventsToConfig()
//------------------------------------------------------------ //------------------------------------------------------------
bool CTimerManager::shutdown() bool CTimerManager::shutdown()
{ {
timerd_debug = 1; timerd_debug = 1; //FIXME
time_t nextAnnounceTime=0; time_t nextAnnounceTime=0;
bool status=false; bool status=false;
dprintf("stopping timermanager thread ...\n"); dprintf("stopping timermanager thread ...\n");
@@ -690,10 +703,10 @@ timerd_debug = 1;
for(;pos != events.end();pos++) for(;pos != events.end();pos++)
{ {
CTimerEvent *event = pos->second; CTimerEvent *event = pos->second;
dprintf("shutdown: timer type %d state %d announceTime: %ld\n", event->eventType, event->eventState, event->announceTime); dprintf("shutdown: timer type %d state %d announceTime: %ld\n", event->eventType, event->eventState, event->announceTime);
if((event->eventType == CTimerd::TIMER_RECORD || if((event->eventType == CTimerd::TIMER_RECORD ||
event->eventType == CTimerd::TIMER_ZAPTO ) && event->eventType == CTimerd::TIMER_ZAPTO ) &&
event->eventState == CTimerd::TIMERSTATE_SCHEDULED) event->eventState < CTimerd::TIMERSTATE_ISRUNNING)
{ {
// Wir wachen nur f<>r Records und Zaptos wieder auf // Wir wachen nur f<>r Records und Zaptos wieder auf
if(event->announceTime < nextAnnounceTime || nextAnnounceTime==0) if(event->announceTime < nextAnnounceTime || nextAnnounceTime==0)
@@ -705,9 +718,9 @@ dprintf("shutdown: timer type %d state %d announceTime: %ld\n", event->eventType
} }
timer_minutes = 0; timer_minutes = 0;
if(nextAnnounceTime!=0) if(nextAnnounceTime != 0)
{ {
timer_minutes = nextAnnounceTime-3*60; timer_minutes = (nextAnnounceTime - 3*60)/60;
} }
dprintf("shutdown: timeset: %d timer_minutes %ld\n", timeset, timer_minutes); dprintf("shutdown: timeset: %d timer_minutes %ld\n", timeset, timer_minutes);