diff options
-rw-r--r-- | firmware/export/system.h | 1 | ||||
-rw-r--r-- | firmware/panic.c | 29 |
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); | |||
36 | void cpu_idle_mode(bool on_off); | 36 | void cpu_idle_mode(bool on_off); |
37 | #else | 37 | #else |
38 | #define FREQ CPU_FREQ | 38 | #define FREQ CPU_FREQ |
39 | #define set_cpu_frequency(frequency) | ||
39 | #define cpu_boost(on_off) | 40 | #define cpu_boost(on_off) |
40 | #define cpu_idle_mode(on_off) | 41 | #define cpu_idle_mode(on_off) |
41 | #endif | 42 | #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 @@ | |||
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 | ||
29 | static char panic_buf[128]; | 32 | static 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 | } |