summaryrefslogtreecommitdiffstats
path: root/firmware/powermgmt.c
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2009-07-26 19:41:24 +0000
committerRob Purchase <shotofadds@rockbox.org>2009-07-26 19:41:24 +0000
commitc6309633a1b33c85b1920c61126ad03f262ab215 (patch)
treee33b3855c02f2ae601d231330ca9cabdfd7beba4 /firmware/powermgmt.c
parenta8d1cfdec8f62f976ba03713da07b88bd927fce5 (diff)
downloadrockbox-c6309633a1b33c85b1920c61126ad03f262ab215.tar.gz
rockbox-c6309633a1b33c85b1920c61126ad03f262ab215.tar.bz2
rockbox-c6309633a1b33c85b1920c61126ad03f262ab215.zip
Re-work D2 power off behaviour.
* Inhibit PCF timeout during shutdown and while charging * Power off the player using the same mechanism as the OF (GPIO) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22056 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r--firmware/powermgmt.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index 64aa5c0637..6ec0307ae5 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -49,9 +49,12 @@
#endif
#if (defined(IAUDIO_X5) || defined(IAUDIO_M5)) && !defined (SIMULATOR)
-#include "pcf50606.h"
#include "lcd-remote-target.h"
#endif
+#if (defined(IAUDIO_X5) || defined(IAUDIO_M5) || defined(COWON_D2)) \
+ && !defined (SIMULATOR)
+#include "pcf50606.h"
+#endif
/** Shared by sim **/
int last_sent_battery_level = 100;
@@ -788,7 +791,7 @@ void sys_poweroff(void)
/* If the main thread fails to shut down the system, we will force a
power off after an 20 second timeout - 28 seconds if recording */
if (shutdown_timeout == 0) {
-#if defined(IAUDIO_X5) || defined(IAUDIO_M5)
+#if defined(IAUDIO_X5) || defined(IAUDIO_M5) || defined(COWON_D2)
pcf50606_reset_timeout(); /* Reset timer on first attempt only */
#endif
#ifdef HAVE_RECORDING
@@ -806,7 +809,7 @@ void cancel_shutdown(void)
{
logf("cancel_shutdown()");
-#if defined(IAUDIO_X5) || defined(IAUDIO_M5)
+#if defined(IAUDIO_X5) || defined(IAUDIO_M5) || defined(COWON_D2)
/* TODO: Move some things to target/ tree */
if (shutdown_timeout)
pcf50606_reset_timeout();