summaryrefslogtreecommitdiff
path: root/bootloader/common.c
diff options
context:
space:
mode:
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 @@
25#include <stdbool.h> 25#include <stdbool.h>
26#include "cpu.h" 26#include "cpu.h"
27#include "common.h" 27#include "common.h"
28#include "power.h"
29#include "kernel.h"
28 30
29/* TODO: Other bootloaders need to be adjusted to set this variable to true 31/* TODO: Other bootloaders need to be adjusted to set this variable to true
30 on a button press - currently only the ipod version does. */ 32 on a button press - currently only the ipod, H10 and Sansa versions do. */
31#ifdef IPOD_ARCH 33#if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined(IRIVER_H10_5GB) || \
34 defined(SANSA_E200)
32bool verbose = false; 35bool verbose = false;
33#else 36#else
34bool verbose = true; 37bool verbose = true;
@@ -99,6 +102,28 @@ char *strerror(int error)
99 } 102 }
100} 103}
101 104
105void error(int errortype, int error)
106{
107 switch(errortype)
108 {
109 case EATA:
110 printf("ATA error: %d", error);
111 break;
112
113 case EDISK:
114 printf("No partition found");
115 break;
116
117 case EBOOTFILE:
118 printf(strerror(error));
119 break;
120 }
121
122 lcd_update();
123 sleep(5*HZ);
124 power_off();
125}
126
102/* Load firmware image in a format created by tools/scramble */ 127/* Load firmware image in a format created by tools/scramble */
103int load_firmware(unsigned char* buf, char* firmware, int buffer_size) 128int load_firmware(unsigned char* buf, char* firmware, int buffer_size)
104{ 129{