summaryrefslogtreecommitdiffstats
path: root/bootloader/common.c
diff options
context:
space:
mode:
authorBarry Wardell <rockbox@barrywardell.net>2007-03-12 22:12:20 +0000
committerBarry Wardell <rockbox@barrywardell.net>2007-03-12 22:12:20 +0000
commit2370998a873f8be85825c8a3b0ccca5a9913c20e (patch)
treea6d5ea4bcf007d22a22f07e26fd98e114c6221b7 /bootloader/common.c
parent62dbd97e909ccacf4165c65f676ee134bd1b880a (diff)
downloadrockbox-2370998a873f8be85825c8a3b0ccca5a9913c20e.tar.gz
rockbox-2370998a873f8be85825c8a3b0ccca5a9913c20e.tar.bz2
rockbox-2370998a873f8be85825c8a3b0ccca5a9913c20e.zip
Disable bootloader messages in the H10 and Sansa bootloaders unless the PLAY (on H10) or RIGHT (on Sansa) button is being held. Messages are still displayed if an error occurs. This has already been implemented for iPod bootloaders, but still needs implementing for the other bootloaders.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12742 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader/common.c')
-rw-r--r--bootloader/common.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/bootloader/common.c b/bootloader/common.c
index 5f824cf1b8..a382816791 100644
--- a/bootloader/common.c
+++ b/bootloader/common.c
@@ -25,10 +25,13 @@
#include <stdbool.h>
#include "cpu.h"
#include "common.h"
+#include "power.h"
+#include "kernel.h"
/* TODO: Other bootloaders need to be adjusted to set this variable to true
- on a button press - currently only the ipod version does. */
-#ifdef IPOD_ARCH
+ on a button press - currently only the ipod, H10 and Sansa versions do. */
+#if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined(IRIVER_H10_5GB) || \
+ defined(SANSA_E200)
bool verbose = false;
#else
bool verbose = true;
@@ -99,6 +102,28 @@ char *strerror(int error)
}
}
+void error(int errortype, int error)
+{
+ switch(errortype)
+ {
+ case EATA:
+ printf("ATA error: %d", error);
+ break;
+
+ case EDISK:
+ printf("No partition found");
+ break;
+
+ case EBOOTFILE:
+ printf(strerror(error));
+ break;
+ }
+
+ lcd_update();
+ sleep(5*HZ);
+ power_off();
+}
+
/* Load firmware image in a format created by tools/scramble */
int load_firmware(unsigned char* buf, char* firmware, int buffer_size)
{