diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2009-01-08 10:15:32 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2009-01-08 10:15:32 +0000 |
commit | 4ed78f5c72649002d78d48d9a117826a5d9c36f9 (patch) | |
tree | 7ebe8ac19acabd74117a638da8dbb0c1cedf2600 /firmware/target/coldfire/system-coldfire.c | |
parent | 32d9752dcc73fd1aaa81d484c3d426ca7856b146 (diff) | |
download | rockbox-4ed78f5c72649002d78d48d9a117826a5d9c36f9.tar.gz rockbox-4ed78f5c72649002d78d48d9a117826a5d9c36f9.zip |
Clean up panicf and introduce system_exception_wait to do further target tasks and wait for a button when an unrecoverable error has occurred (panic, UIE, etc.). Returning from that function should reboot or don't return from it. Move UIE and __div0 for ARM to its own file.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19716 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/coldfire/system-coldfire.c')
-rw-r--r-- | firmware/target/coldfire/system-coldfire.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/firmware/target/coldfire/system-coldfire.c b/firmware/target/coldfire/system-coldfire.c index e04255746f..c4651a3c80 100644 --- a/firmware/target/coldfire/system-coldfire.c +++ b/firmware/target/coldfire/system-coldfire.c | |||
@@ -177,16 +177,11 @@ static void system_display_exception_info(unsigned long format, | |||
177 | lcd_puts(0, 1, str); | 177 | lcd_puts(0, 1, str); |
178 | lcd_update(); | 178 | lcd_update(); |
179 | 179 | ||
180 | /* set cpu frequency to 11mhz (to prevent overheating) */ | 180 | system_exception_wait(); |
181 | DCR = (DCR & ~0x01ff) | 1; | ||
182 | PLLCR = EXCP_PLLCR; | ||
183 | 181 | ||
184 | while (1) | 182 | /* Start watchdog timer with 512 cycles timeout. Don't service it. */ |
185 | { | 183 | SYPCR = 0xc0; |
186 | if ((EXCP_BUTTON_GPIO_READ & EXCP_BUTTON_MASK) == EXCP_BUTTON_VALUE) | 184 | while (1); |
187 | SYPCR = 0xc0; | ||
188 | /* Start watchdog timer with 512 cycles timeout. Don't service it. */ | ||
189 | } | ||
190 | 185 | ||
191 | /* We need a reset method that works in all cases. Calling system_reboot() | 186 | /* We need a reset method that works in all cases. Calling system_reboot() |
192 | doesn't work when we're called from the debug interrupt, because then | 187 | doesn't work when we're called from the debug interrupt, because then |
@@ -294,6 +289,14 @@ void system_reboot (void) | |||
294 | asm(" jmp (%a0)"); | 289 | asm(" jmp (%a0)"); |
295 | } | 290 | } |
296 | 291 | ||
292 | void system_exception_wait(void) | ||
293 | { | ||
294 | /* set cpu frequency to 11mhz (to prevent overheating) */ | ||
295 | DCR = (DCR & ~0x01ff) | 1; | ||
296 | PLLCR = EXCP_PLLCR; | ||
297 | while ((EXCP_BUTTON_GPIO_READ & EXCP_BUTTON_MASK) != EXCP_BUTTON_VALUE); | ||
298 | } | ||
299 | |||
297 | /* Utilise the breakpoint hardware to catch invalid memory accesses. */ | 300 | /* Utilise the breakpoint hardware to catch invalid memory accesses. */ |
298 | int system_memory_guard(int newmode) | 301 | int system_memory_guard(int newmode) |
299 | { | 302 | { |