This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Remote LCD display fix

By: a guest on Feb 9th, 2011  |  syntax: Diff  |  size: 2.16 KB  |  views: 115  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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;
clone this paste RAW Paste Data