Author: ks156
Date: 2009-10-20 09:03:26 +0200 (Tue, 20 Oct 2009)
New Revision: 5749

Modified:
   firmware/tuxcore/trunk/main.c
Log:
* Restore the statuses when quitting the sleep mode.
  This should prevent the wings inversion.


Modified: firmware/tuxcore/trunk/main.c
===================================================================
--- firmware/tuxcore/trunk/main.c       2009-10-20 06:51:55 UTC (rev 5748)
+++ firmware/tuxcore/trunk/main.c       2009-10-20 07:03:26 UTC (rev 5749)
@@ -309,8 +309,9 @@
 static void sleep(void)
 {
     uint8_t PRR_bak;
+    uint8_t status_bak;
+    /* Set power savings configuration. */
 
-    /* Set power savings configuration. */
     cli();
     closeIO();
     sensors_disable();
@@ -329,6 +330,7 @@
     PCIFR = _BV(PCIE0);
     PCICR |= _BV(PCIE0);
 
+    status_bak = gStatus.pos;
     set_sleep_mode(SLEEP_MODE_PWR_DOWN);
     sleep_enable();
     sei();
@@ -345,6 +347,7 @@
     led_init();
     communication_init();
     irGetRC5();
+    gStatus.pos = status_bak;
 
     /* Wait 200ms for the pull-up to rise before next standalone behavior
      * otherwise position switches signals are wrong */


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to