diff options
Diffstat (limited to 'bootloader/common.c')
-rw-r--r-- | bootloader/common.c | 29 |
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) | ||
32 | bool verbose = false; | 35 | bool verbose = false; |
33 | #else | 36 | #else |
34 | bool verbose = true; | 37 | bool verbose = true; |
@@ -99,6 +102,28 @@ char *strerror(int error) | |||
99 | } | 102 | } |
100 | } | 103 | } |
101 | 104 | ||
105 | void 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 */ |
103 | int load_firmware(unsigned char* buf, char* firmware, int buffer_size) | 128 | int load_firmware(unsigned char* buf, char* firmware, int buffer_size) |
104 | { | 129 | { |