Advertisement
svenhoefer

Untitled

Nov 27th, 2017
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.32 KB | None | 0 0
  1. diff --git a/src/neutrino.cpp b/src/neutrino.cpp
  2. index ee15326..656d7a8 100644
  3. --- a/src/neutrino.cpp
  4. +++ b/src/neutrino.cpp
  5. @@ -2311,8 +2311,10 @@ void CNeutrinoApp::InitSectiondClient()
  6.  #include <cs_frontpanel.h>
  7.  #endif
  8.  
  9. -void wake_up(bool &wakeup)
  10. +bool get_wakeup()
  11.  {
  12. +   bool wakeup = false;
  13. +
  14.  #if HAVE_COOL_HARDWARE
  15.  #ifndef FP_IOCTL_CLEAR_WAKEUP_TIMER
  16.  #define FP_IOCTL_CLEAR_WAKEUP_TIMER 10
  17. @@ -2333,6 +2335,7 @@ void wake_up(bool &wakeup)
  18.         close(fd);
  19.     }
  20.  #endif
  21. +
  22.     /* prioritize proc filesystem */
  23.     if (access("/proc/stb/fp/was_timer_wakeup", F_OK) == 0)
  24.     {
  25. @@ -2355,11 +2358,14 @@ void wake_up(bool &wakeup)
  26.     }
  27.     printf("[timerd] wakeup from standby: %s\n", wakeup ? "yes" : "no");
  28.  
  29. -   if(!wakeup){
  30. +   if (!wakeup)
  31. +   {
  32.         puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT ".");
  33.         if (my_system(NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT) != 0)
  34.             perror(NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT " failed");
  35.     }
  36. +
  37. +   return wakeup;
  38.  }
  39.  
  40.  int CNeutrinoApp::run(int argc, char **argv)
  41. @@ -2496,21 +2502,19 @@ TIMER_START();
  42.     }
  43.  
  44.     //timer start
  45. -   long timerd_signal = 0;
  46. -   timer_wakeup = false;//init
  47. -   wake_up( timer_wakeup );
  48. +   timer_wakeup = (get_wakeup() && g_settings.shutdown_timer_record_type);
  49. +   g_settings.shutdown_timer_record_type = false;
  50.  
  51.     init_cec_setting = true;
  52. -   if(!(g_settings.shutdown_timer_record_type && timer_wakeup && g_settings.hdmi_cec_mode)){
  53. +   if(!(timer_wakeup && g_settings.hdmi_cec_mode))
  54. +   {
  55.         //init cec settings
  56.         CCECSetup cecsetup;
  57.         cecsetup.setCECSettings();
  58.         init_cec_setting = false;
  59.     }
  60. -   timer_wakeup = (timer_wakeup && g_settings.shutdown_timer_record_type);
  61. -   g_settings.shutdown_timer_record_type = false;
  62.  
  63. -   timerd_signal = (timer_wakeup && g_settings.shutdown_timer_record_type);
  64. +   long timerd_signal = timer_wakeup;
  65.     pthread_create (&timer_thread, NULL, timerd_main_thread, (void *)&timerd_signal);
  66.     timerd_thread_started = true;
  67.  
  68. @@ -4132,7 +4136,7 @@ void CNeutrinoApp::ExitRun(int exit_code)
  69.             struct tm *tm = localtime(&t);
  70.             char date[30];
  71.             strftime(date, sizeof(date), "%c", tm);
  72. -           printf("timer_wakeup: %s (%ld)\n", date, timer_minutes * 60);
  73. +           printf("wakeup_time: %s (%ld)\n", date, timer_minutes * 60);
  74.  
  75.             /* prioritize proc filesystem */
  76.             if (access("/proc/stb/fp/wakeup_time", F_OK) == 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement