summaryrefslogtreecommitdiff
path: root/firmware/panic.c
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/panic.c
parent4a2feaa30d96a7b38407551c9bece8b73a3a2aac (diff)
downloadrockbox-e6c6d22240696820643ca7c3561bb4172b5865f3.tar.gz
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/panic.c')
-rw-r--r--firmware/panic.c29
1 files changed, 28 insertions, 1 deletions
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 @@
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20#include "config.h"
20#include <stdio.h> 21#include <stdio.h>
21#include <stdarg.h> 22#include <stdarg.h>
22#include <string.h> 23#include <string.h>
@@ -25,6 +26,8 @@
25#include "font.h" 26#include "font.h"
26#include "debug.h" 27#include "debug.h"
27#include "led.h" 28#include "led.h"
29#include "power.h"
30#include "system.h"
28 31
29static char panic_buf[128]; 32static char panic_buf[128];
30 33
@@ -76,6 +79,13 @@ void panicf( const char *fmt, ...)
76 /* no LCD */ 79 /* no LCD */
77#endif 80#endif
78 DEBUGF(panic_buf); 81 DEBUGF(panic_buf);
82
83 set_cpu_frequency(0);
84
85#ifdef HAVE_ATA_POWER_OFF
86 ide_power_enable(false);
87#endif
88
79 while (1) 89 while (1)
80 { 90 {
81#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) 91#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR)
@@ -83,7 +93,24 @@ void panicf( const char *fmt, ...)
83 led (state); 93 led (state);
84 state = state?false:true; 94 state = state?false:true;
85 95
86 for (i = 0; i < 400000; ++i); 96 for (i = 0; i < 240000; ++i);
97#endif
98#ifdef IRIVER_H100_SERIES
99 /* check for the ON button (and !hold) */
100 if ((GPIO1_READ & 0x22) == 0)
101 system_reboot();
102#elif CONFIG_CPU == SH7034
103 /* try to restart firmware if ON is pressed */
104#if CONFIG_KEYPAD == PLAYER_PAD
105 if (!(PADR & 0x0020))
106#elif CONFIG_KEYPAD == RECORDER_PAD
107#ifdef HAVE_FMADC
108 if (!(PCDR & 0x0008))
109#else
110 if (!(PBDR & 0x0100))
111#endif
112#endif
113 system_reboot();
87#endif 114#endif
88 } 115 }
89} 116}