From fee24eefa9c843bac5586fb762da2d8871df3a65 Mon Sep 17 00:00:00 2001 From: Rob Purchase Date: Sat, 25 Jul 2009 18:44:57 +0000 Subject: [PATCH] D2: Fix the POWER button check after an exception/panic. Make this power the player off, since we don't know how to force a reboot yet. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22036 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/tcc780x/system-tcc780x.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/firmware/target/arm/tcc780x/system-tcc780x.c b/firmware/target/arm/tcc780x/system-tcc780x.c index 6362f17f71..d1927c065f 100644 --- a/firmware/target/arm/tcc780x/system-tcc780x.c +++ b/firmware/target/arm/tcc780x/system-tcc780x.c @@ -22,6 +22,7 @@ #include "kernel.h" #include "system.h" #include "panic.h" +#include "power.h" #define default_interrupt(name) \ extern __attribute__((weak,alias("UIRQ"))) void name (void) @@ -282,12 +283,16 @@ void system_reboot(void) #endif /* TODO: implement reboot (eg. jump to boot ROM?) */ - while (1); + power_off(); } void system_exception_wait(void) { - while ((GPIOA & 0x10) == 0); /* check for power button */ +#ifdef COWON_D2 + while ((GPIOA & 0x4) != 0); /* check for power button */ +#else + #error "system_exception_wait not implemented for this target" +#endif } int system_memory_guard(int newmode)