Advertisement
Guest User

Remote LCD display fix

a guest
Feb 9th, 2011
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.16 KB | None | 0 0
  1. diff --git a/apps/misc.c b/apps/misc.c
  2. index a08dac3..49141fe 100644
  3. --- a/apps/misc.c
  4. +++ b/apps/misc.c
  5. @@ -256,12 +256,6 @@ static void system_restore(void)
  6.  
  7.  static bool clean_shutdown(void (*callback)(void *), void *parameter)
  8.  {
  9. -#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
  10. -    (void)callback;
  11. -    (void)parameter;
  12. -    bookmark_autobookmark(false);
  13. -    call_storage_idle_notifys(true);
  14. -#else
  15.      long msg_id = -1;
  16.      int i;
  17.  
  18. @@ -372,7 +366,7 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
  19.  
  20.          shutdown_hw();
  21.      }
  22. -#endif
  23. +
  24.      return false;
  25.  }
  26.  
  27. diff --git a/firmware/target/hosted/maemo/maemo-thread.c b/firmware/target/hosted/maemo/maemo-thread.c
  28. index f655ed5..3ec0151 100644
  29. --- a/firmware/target/hosted/maemo/maemo-thread.c
  30. +++ b/firmware/target/hosted/maemo/maemo-thread.c
  31. @@ -23,6 +23,7 @@
  32.  #include <libhal.h>
  33.  #include <libosso.h>
  34.  #include <SDL_thread.h>
  35. +#include <SDL_events.h>
  36.  
  37.  #include "config.h"
  38.  #include "system.h"
  39. @@ -205,16 +206,26 @@ bool battery_level_safe(void)
  40.  void set_poweroff_timeout(int timeout)
  41.  {
  42.      (void)timeout;
  43. +    printf("TOMJ: Called set_poweroff_timer: %d\n", timeout);
  44.  }
  45.  
  46.  void reset_poweroff_timer(void)
  47.  {
  48. +    printf("TOMJ: Called reset_poweroff_timer\n");
  49.  }
  50.  
  51.  void shutdown_hw(void)
  52.  {
  53. +    printf("TOMJ: Called shutdown_hw\n");
  54. +
  55. +    /* Shut down SDL gui loop */
  56. +    SDL_Event event;
  57. +    memset(&event, 0, sizeof(SDL_Event));
  58. +    event.type = SDL_USEREVENT;
  59. +    SDL_PushEvent(&event);
  60.  }
  61.  
  62.  void cancel_shutdown(void)
  63.  {
  64. +    printf("TOMJ: Called cancel_shutdown\n");
  65.  }
  66. diff --git a/firmware/target/hosted/sdl/button-sdl.c b/firmware/target/hosted/sdl/button-sdl.c
  67. index 25dad09..2d6ef70 100644
  68. --- a/firmware/target/hosted/sdl/button-sdl.c
  69. +++ b/firmware/target/hosted/sdl/button-sdl.c
  70. @@ -261,7 +261,12 @@ static bool event_handler(SDL_Event *event)
  71.          break;
  72.      }
  73.      case SDL_QUIT:
  74. +        /* Post poweroff. Will post SDL user event in shutdown_hw() if succesful. */
  75. +        queue_broadcast(SYS_POWEROFF, 0);
  76. +        break;
  77. +    case SDL_USEREVENT:
  78.          return true;
  79. +        break;
  80.      }
  81.  
  82.      return false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement