summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-10-08 21:34:26 +0000
committerJens Arnold <amiconn@rockbox.org>2006-10-08 21:34:26 +0000
commitf4e775962548e8fe581eb2b370fc73adaf252385 (patch)
treea129416d262577355793363a6483490f17cad66a
parent994257ec6cb0a770cb3e3d1a49f2d1686fc70594 (diff)
downloadrockbox-f4e775962548e8fe581eb2b370fc73adaf252385.tar.gz
rockbox-f4e775962548e8fe581eb2b370fc73adaf252385.zip
UIE(), panicf(): Make reboot with ON react immediately on targets with real LED (archos recorders, player).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11154 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/panic.c14
-rw-r--r--firmware/system.c14
2 files changed, 16 insertions, 12 deletions
diff --git a/firmware/panic.c b/firmware/panic.c
index dc9876e272..736d4bbf24 100644
--- a/firmware/panic.c
+++ b/firmware/panic.c
@@ -40,7 +40,8 @@ void panicf( const char *fmt, ...)
#ifndef SIMULATOR
#if CONFIG_LED == LED_REAL
- bool state = true;
+ bool state = false;
+ int i = 0;
#endif
/* Disable interrupts */
@@ -90,11 +91,12 @@ void panicf( const char *fmt, ...)
{
#ifndef SIMULATOR
#if CONFIG_LED == LED_REAL
- volatile long i;
- led (state);
- state = !state;
-
- for (i = 0; i < 240000; ++i);
+ if (--i <= 0)
+ {
+ state = !state;
+ led(state);
+ i = 240000;
+ }
#endif
/* try to restart firmware if ON is pressed */
diff --git a/firmware/system.c b/firmware/system.c
index bb7923792d..655b08d1bf 100644
--- a/firmware/system.c
+++ b/firmware/system.c
@@ -1017,7 +1017,8 @@ void UIE (unsigned int pc) __attribute__((section(".text")));
void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */
{
#if CONFIG_LED == LED_REAL
- bool state = true;
+ bool state = false;
+ int i = 0;
#endif
unsigned int n;
char str[32];
@@ -1043,11 +1044,12 @@ void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */
while (1)
{
#if CONFIG_LED == LED_REAL
- volatile int i;
- led (state);
- state = !state;
-
- for (i = 0; i < 240000; ++i);
+ if (--i <= 0)
+ {
+ state = !state;
+ led(state);
+ i = 240000;
+ }
#endif
/* try to restart firmware if ON is pressed */