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
diff --git a/bootloader/common.c b/bootloader/common.c
index 5f824cf..a382816 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 @@
     }
 }
 
+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)
 {