mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 09:51:13 +02:00
neutrino: try to fix timer_wakeup handling; ...
The return to deepstandby after timer-wakeups was broken.
Origin commit data
------------------
Commit: a063b370aa
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-11-27 (Mon, 27 Nov 2017)
Origin message was:
------------------
- neutrino: try to fix timer_wakeup handling; ...
The return to deepstandby after timer-wakeups was broken.
This commit is contained in:
@@ -2311,8 +2311,10 @@ void CNeutrinoApp::InitSectiondClient()
|
|||||||
#include <cs_frontpanel.h>
|
#include <cs_frontpanel.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void wake_up(bool &wakeup)
|
bool is_wakeup()
|
||||||
{
|
{
|
||||||
|
bool wakeup = false;
|
||||||
|
|
||||||
#if HAVE_COOL_HARDWARE
|
#if HAVE_COOL_HARDWARE
|
||||||
#ifndef FP_IOCTL_CLEAR_WAKEUP_TIMER
|
#ifndef FP_IOCTL_CLEAR_WAKEUP_TIMER
|
||||||
#define FP_IOCTL_CLEAR_WAKEUP_TIMER 10
|
#define FP_IOCTL_CLEAR_WAKEUP_TIMER 10
|
||||||
@@ -2333,6 +2335,7 @@ void wake_up(bool &wakeup)
|
|||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* prioritize proc filesystem */
|
/* prioritize proc filesystem */
|
||||||
if (access("/proc/stb/fp/was_timer_wakeup", F_OK) == 0)
|
if (access("/proc/stb/fp/was_timer_wakeup", F_OK) == 0)
|
||||||
{
|
{
|
||||||
@@ -2355,11 +2358,14 @@ void wake_up(bool &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)
|
||||||
|
{
|
||||||
puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT ".");
|
puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT ".");
|
||||||
if (my_system(NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT) != 0)
|
if (my_system(NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT) != 0)
|
||||||
perror(NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT " failed");
|
perror(NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT " failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return wakeup;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CNeutrinoApp::run(int argc, char **argv)
|
int CNeutrinoApp::run(int argc, char **argv)
|
||||||
@@ -2496,21 +2502,19 @@ TIMER_START();
|
|||||||
}
|
}
|
||||||
|
|
||||||
//timer start
|
//timer start
|
||||||
long timerd_signal = 0;
|
timer_wakeup = (is_wakeup() && g_settings.shutdown_timer_record_type);
|
||||||
timer_wakeup = false;//init
|
g_settings.shutdown_timer_record_type = false;
|
||||||
wake_up( timer_wakeup );
|
|
||||||
|
|
||||||
init_cec_setting = true;
|
init_cec_setting = true;
|
||||||
if(!(g_settings.shutdown_timer_record_type && timer_wakeup && g_settings.hdmi_cec_mode)){
|
if(!(timer_wakeup && g_settings.hdmi_cec_mode))
|
||||||
|
{
|
||||||
//init cec settings
|
//init cec settings
|
||||||
CCECSetup cecsetup;
|
CCECSetup cecsetup;
|
||||||
cecsetup.setCECSettings();
|
cecsetup.setCECSettings();
|
||||||
init_cec_setting = false;
|
init_cec_setting = false;
|
||||||
}
|
}
|
||||||
timer_wakeup = (timer_wakeup && g_settings.shutdown_timer_record_type);
|
|
||||||
g_settings.shutdown_timer_record_type = false;
|
|
||||||
|
|
||||||
timerd_signal = (timer_wakeup && g_settings.shutdown_timer_record_type);
|
long timerd_signal = timer_wakeup;
|
||||||
pthread_create (&timer_thread, NULL, timerd_main_thread, (void *)&timerd_signal);
|
pthread_create (&timer_thread, NULL, timerd_main_thread, (void *)&timerd_signal);
|
||||||
timerd_thread_started = true;
|
timerd_thread_started = true;
|
||||||
|
|
||||||
@@ -4132,7 +4136,7 @@ void CNeutrinoApp::ExitRun(int exit_code)
|
|||||||
struct tm *tm = localtime(&t);
|
struct tm *tm = localtime(&t);
|
||||||
char date[30];
|
char date[30];
|
||||||
strftime(date, sizeof(date), "%c", tm);
|
strftime(date, sizeof(date), "%c", tm);
|
||||||
printf("timer_wakeup: %s (%ld)\n", date, timer_minutes * 60);
|
printf("wakeup_time: %s (%ld)\n", date, timer_minutes * 60);
|
||||||
|
|
||||||
/* prioritize proc filesystem */
|
/* prioritize proc filesystem */
|
||||||
if (access("/proc/stb/fp/wakeup_time", F_OK) == 0)
|
if (access("/proc/stb/fp/wakeup_time", F_OK) == 0)
|
||||||
|
Reference in New Issue
Block a user