summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-09-12 10:34:27 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-09-12 10:34:27 +0000
commite6c6d22240696820643ca7c3561bb4172b5865f3 (patch)
treeec05cf484c6003e78567b97abd234e0dc5cf3f21 /firmware
parent4a2feaa30d96a7b38407551c9bece8b73a3a2aac (diff)
downloadrockbox-e6c6d22240696820643ca7c3561bb4172b5865f3.tar.gz
rockbox-e6c6d22240696820643ca7c3561bb4172b5865f3.tar.bz2
rockbox-e6c6d22240696820643ca7c3561bb4172b5865f3.zip
Now panicf() shuts off the hard drive and lowers the CPU frequency, it also reboots if ON is pressed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7510 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/system.h1
-rw-r--r--firmware/panic.c29
2 files changed, 29 insertions, 1 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h
index 1fc9b09632..58e6570d3a 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -36,6 +36,7 @@ void cpu_boost(bool on_off);
void cpu_idle_mode(bool on_off);
#else
#define FREQ CPU_FREQ
+#define set_cpu_frequency(frequency)
#define cpu_boost(on_off)
#define cpu_idle_mode(on_off)
#endif
diff --git a/firmware/panic.c b/firmware/panic.c
index fb024693e1..2a78ff5eff 100644
--- a/firmware/panic.c
+++ b/firmware/panic.c
@@ -17,6 +17,7 @@
*
****************************************************************************/
+#include "config.h"
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
@@ -25,6 +26,8 @@
#include "font.h"
#include "debug.h"
#include "led.h"
+#include "power.h"
+#include "system.h"
static char panic_buf[128];
@@ -76,6 +79,13 @@ void panicf( const char *fmt, ...)
/* no LCD */
#endif
DEBUGF(panic_buf);
+
+ set_cpu_frequency(0);
+
+#ifdef HAVE_ATA_POWER_OFF
+ ide_power_enable(false);
+#endif
+
while (1)
{
#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR)
@@ -83,7 +93,24 @@ void panicf( const char *fmt, ...)
led (state);
state = state?false:true;
- for (i = 0; i < 400000; ++i);
+ for (i = 0; i < 240000; ++i);
+#endif
+#ifdef IRIVER_H100_SERIES
+ /* check for the ON button (and !hold) */
+ if ((GPIO1_READ & 0x22) == 0)
+ system_reboot();
+#elif CONFIG_CPU == SH7034
+ /* try to restart firmware if ON is pressed */
+#if CONFIG_KEYPAD == PLAYER_PAD
+ if (!(PADR & 0x0020))
+#elif CONFIG_KEYPAD == RECORDER_PAD
+#ifdef HAVE_FMADC
+ if (!(PCDR & 0x0008))
+#else
+ if (!(PBDR & 0x0100))
+#endif
+#endif
+ system_reboot();
#endif
}
}