mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
neutrino: add deep-standby support on SPARK
This commit is contained in:
@@ -2970,22 +2970,25 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
|
|||||||
g_settings.shutdown_timer_record_type = timer_is_rec;
|
g_settings.shutdown_timer_record_type = timer_is_rec;
|
||||||
saveSetup(NEUTRINO_SETTINGS_FILE);
|
saveSetup(NEUTRINO_SETTINGS_FILE);
|
||||||
|
|
||||||
|
#if HAVE_COOL_HARDWARE
|
||||||
if(retcode) {
|
if(retcode) {
|
||||||
|
#endif
|
||||||
const char *neutrino_enter_deepstandby_script = CONFIGDIR "/deepstandby.on";
|
const char *neutrino_enter_deepstandby_script = CONFIGDIR "/deepstandby.on";
|
||||||
printf("[%s] executing %s\n",__FILE__ ,neutrino_enter_deepstandby_script);
|
printf("[%s] executing %s\n",__FILE__ ,neutrino_enter_deepstandby_script);
|
||||||
if (safe_system(neutrino_enter_deepstandby_script) != 0)
|
if (safe_system(neutrino_enter_deepstandby_script) != 0)
|
||||||
perror(neutrino_enter_deepstandby_script );
|
perror(neutrino_enter_deepstandby_script );
|
||||||
|
|
||||||
printf("entering off state\n");
|
printf("entering off state\n");
|
||||||
|
printf("timer_minutes: %ld\n", timer_minutes);
|
||||||
mode = mode_off;
|
mode = mode_off;
|
||||||
//CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_SHUTDOWN));
|
//CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_SHUTDOWN));
|
||||||
|
|
||||||
|
#if HAVE_COOL_HARDWARE
|
||||||
system("/etc/init.d/rcK");
|
system("/etc/init.d/rcK");
|
||||||
system("/bin/sync");
|
system("/bin/sync");
|
||||||
system("/bin/umount -a");
|
system("/bin/umount -a");
|
||||||
sleep(1);
|
sleep(1);
|
||||||
{
|
{
|
||||||
#if HAVE_COOL_HARDWARE
|
|
||||||
standby_data_t standby;
|
standby_data_t standby;
|
||||||
time_t mtime = time(NULL);
|
time_t mtime = time(NULL);
|
||||||
struct tm *tmtime = localtime(&mtime);
|
struct tm *tmtime = localtime(&mtime);
|
||||||
@@ -3039,10 +3042,8 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
|
|||||||
while(true) sleep(1);
|
while(true) sleep(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
reboot(LINUX_REBOOT_CMD_RESTART);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#if 0
|
#if 0
|
||||||
neutrino_msg_t msg;
|
neutrino_msg_t msg;
|
||||||
neutrino_msg_data_t data;
|
neutrino_msg_data_t data;
|
||||||
@@ -3081,7 +3082,22 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if HAVE_COOL_HARDWARE
|
||||||
} else {
|
} else {
|
||||||
|
#endif
|
||||||
|
if (timer_minutes)
|
||||||
|
{
|
||||||
|
FILE *f = fopen("/tmp/.timer", "w");
|
||||||
|
if (f)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "timer_wakeup: %ld\n", timer_minutes * 60);
|
||||||
|
fprintf(f, "%ld\n", timer_minutes * 60);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
perror("fopen /tmp/.timer");
|
||||||
|
}
|
||||||
|
|
||||||
if (g_RCInput != NULL)
|
if (g_RCInput != NULL)
|
||||||
delete g_RCInput;
|
delete g_RCInput;
|
||||||
//fan speed
|
//fan speed
|
||||||
@@ -3104,7 +3120,9 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
|
|||||||
_exit(retcode);
|
_exit(retcode);
|
||||||
#endif
|
#endif
|
||||||
exit(retcode);
|
exit(retcode);
|
||||||
|
#if HAVE_COOL_HARDWARE
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -132,6 +132,9 @@ void CNeutrinoApp::InitMenuMain()
|
|||||||
dprintf(DEBUG_DEBUG, "init mainmenue\n");
|
dprintf(DEBUG_DEBUG, "init mainmenue\n");
|
||||||
|
|
||||||
unsigned int system_rev = cs_get_revision();
|
unsigned int system_rev = cs_get_revision();
|
||||||
|
#if HAVE_SPARK_HARDWARE
|
||||||
|
system_rev = 8; // :-)
|
||||||
|
#endif
|
||||||
|
|
||||||
// Dynamic renumbering
|
// Dynamic renumbering
|
||||||
personalize.setShortcut();
|
personalize.setShortcut();
|
||||||
|
@@ -82,6 +82,13 @@ void CTimerManager::Init(void)
|
|||||||
wakeup = ((wk.source == WAKEUP_SOURCE_TIMER) /* || (wk.source == WAKEUP_SOURCE_PWLOST)*/);
|
wakeup = ((wk.source == WAKEUP_SOURCE_TIMER) /* || (wk.source == WAKEUP_SOURCE_PWLOST)*/);
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
/* not platform specific - this is created by the init process */
|
||||||
|
if (access("/tmp/.timer_wakeup", F_OK) == 0) {
|
||||||
|
wakeup = true;
|
||||||
|
unlink("/tmp/.timer_wakeup");
|
||||||
|
}
|
||||||
|
|
||||||
printf("[timerd] wakeup from standby: %s\n", wakeup ? "yes" : "no");
|
printf("[timerd] wakeup from standby: %s\n", wakeup ? "yes" : "no");
|
||||||
if(wakeup){
|
if(wakeup){
|
||||||
creat("/tmp/.wakeup", 0);
|
creat("/tmp/.wakeup", 0);
|
||||||
@@ -92,7 +99,6 @@ void CTimerManager::Init(void)
|
|||||||
if (system(neutrino_leave_deepstandby_script) != 0)
|
if (system(neutrino_leave_deepstandby_script) != 0)
|
||||||
perror( neutrino_leave_deepstandby_script );
|
perror( neutrino_leave_deepstandby_script );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
loadRecordingSafety();
|
loadRecordingSafety();
|
||||||
|
|
||||||
//thread starten
|
//thread starten
|
||||||
|
Reference in New Issue
Block a user