diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-11-05 11:34:57 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-11-05 11:34:57 +0000 |
commit | 747be871ba63c265743c138bc7157688aa8335c3 (patch) | |
tree | d9c3a4241fefe574e5747452257ad43122cb45b3 | |
parent | 72f98786a0b73722d2688c7509a1acc528b727af (diff) | |
download | rockbox-747be871ba63c265743c138bc7157688aa8335c3.tar.gz rockbox-747be871ba63c265743c138bc7157688aa8335c3.zip |
System reboot from UIE() now works in all cases, even from a debug interrupt (memory guard).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7756 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/system.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/firmware/system.c b/firmware/system.c index 32ea3c0c03..d6b48247ea 100644 --- a/firmware/system.c +++ b/firmware/system.c @@ -451,13 +451,21 @@ void UIE (void) /* Unexpected Interrupt or Exception */ /* set cpu frequency to 11mhz (to prevent overheating) */ DCR = (DCR & ~0x01ff) | 1; - PLLCR = 0x00000000; + PLLCR = 0x10800000; while (1) { /* check for the ON button (and !hold) */ if ((GPIO1_READ & 0x22) == 0) - system_reboot(); + SYPCR = 0xc0; + /* Start watchdog timer with 512 cycles timeout. Don't service it. */ + + /* We need a reset method that works in all cases. Calling system_reboot() + doesn't work when we're called from the debug interrupt, because then + the CPU is in emulator mode and the only ways leaving it are exexcuting + an rte instruction or performing a reset. Even disabling the breakpoint + logic and performing special rte magic doesn't make system_reboot() + reliable. The system restarts, but boot often fails with ata error -42. */ } } |