mirror of
https://github.com/mist-devel/mist-firmware.git
synced 2026-01-11 23:43:04 +00:00
Cleanup error numbers
This commit is contained in:
parent
c80ef8220a
commit
c01027f0a2
4
config.c
4
config.c
@ -453,7 +453,7 @@ static void ApplyConfiguration(char reloadkickstart)
|
||||
if (!UploadKickstart(config.kickstart)) {
|
||||
strcpy(config.kickstart, "AROS.ROM");
|
||||
if (!UploadKickstart(config.kickstart)) {
|
||||
FatalError(6);
|
||||
FatalError(ERROR_KICKSTART_UPLOAD);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -587,7 +587,7 @@ static void ApplyConfiguration(char reloadkickstart)
|
||||
if (!UploadKickstart(config.kickstart)) {
|
||||
strcpy(config.kickstart, "KICK.ROM");
|
||||
if (!UploadKickstart(config.kickstart)) {
|
||||
FatalError(6);
|
||||
FatalError(ERROR_KICKSTART_UPLOAD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
8
errors.h
8
errors.h
@ -1,7 +1,13 @@
|
||||
#define ERROR_NONE 0
|
||||
#define ERROR_FILE_NOT_FOUND 1
|
||||
#define ERROR_INVALID_DATA 2
|
||||
#define ERROR_UPDATE_FAILED 3
|
||||
#define ERROR_UPDATE_INIT_FAILED 3
|
||||
#define ERROR_BITSTREAM_OPEN 4
|
||||
#define ERROR_UPDATE_PROGRESS_FAILED 5
|
||||
#define ERROR_KICKSTART_UPLOAD 6
|
||||
#define ERROR_UPDATE_FAILED 7
|
||||
#define ERROR_READ_BITSTREAM_FAILED 8
|
||||
#define ERROR_DIRECT_ACCESS_INTERNAL 10
|
||||
|
||||
extern unsigned char Error;
|
||||
|
||||
|
||||
15
fpga.c
15
fpga.c
@ -267,7 +267,7 @@ unsigned char ConfigureFpga(const char *name)
|
||||
if (f_open(&file, name, FA_READ) != FR_OK)
|
||||
{
|
||||
iprintf("No FPGA configuration file found!\r");
|
||||
FatalError(4);
|
||||
FatalError(ERROR_BITSTREAM_OPEN);
|
||||
}
|
||||
|
||||
iprintf("FPGA bitstream file %s opened, file size = %llu\r", name, f_size(&file));
|
||||
@ -291,7 +291,7 @@ unsigned char ConfigureFpga(const char *name)
|
||||
{
|
||||
iprintf("FPGA NSTATUS is NOT high!\r");
|
||||
f_close(&file);
|
||||
FatalError(3);
|
||||
FatalError(ERROR_UPDATE_INIT_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
@ -316,7 +316,7 @@ unsigned char ConfigureFpga(const char *name)
|
||||
|
||||
if (f_read(&file, sector_buffer, SECTOR_BUFFER_SIZE, &br) != FR_OK) {
|
||||
f_close(&file);
|
||||
return(0);
|
||||
FatalError(ERROR_READ_BITSTREAM_FAILED);
|
||||
}
|
||||
|
||||
ptr = sector_buffer;
|
||||
@ -334,7 +334,7 @@ unsigned char ConfigureFpga(const char *name)
|
||||
if ( !ALTERA_NSTATUS_STATE ) {
|
||||
iprintf("FPGA NSTATUS is NOT high!\r");
|
||||
f_close(&file);
|
||||
FatalError(5);
|
||||
FatalError(ERROR_UPDATE_PROGRESS_FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -348,7 +348,7 @@ unsigned char ConfigureFpga(const char *name)
|
||||
// check if DONE is high
|
||||
if (!ALTERA_DONE_STATE) {
|
||||
iprintf("FPGA Configuration done but contains error... CONF_DONE is LOW\r");
|
||||
FatalError(5);
|
||||
FatalError(ERROR_UPDATE_FAILED);
|
||||
}
|
||||
|
||||
|
||||
@ -374,7 +374,7 @@ unsigned char ConfigureFpga(const char *name)
|
||||
|
||||
iprintf("FPGA Initialization finish but contains error: NSTATUS is %s and CONF_DONE is %s.\r",
|
||||
ALTERA_NSTATUS_STATE?"HIGH":"LOW", ALTERA_DONE_STATE?"HIGH":"LOW" );
|
||||
FatalError(5);
|
||||
FatalError(ERROR_UPDATE_FAILED);
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -923,8 +923,9 @@ void fpga_init(const char *name) {
|
||||
time = GetRTTC() - time;
|
||||
iprintf("FPGA configured in %lu ms\r", time);
|
||||
} else {
|
||||
// should not reach this code
|
||||
iprintf("FPGA configuration failed\r");
|
||||
FatalError(8); // 3
|
||||
FatalError(ERROR_UPDATE_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
8
main.c
8
main.c
@ -161,7 +161,7 @@ int main(void)
|
||||
if(USB_BOOT_VAR == USB_BOOT_VALUE)
|
||||
if (!GetUSBStorageDevices()) {
|
||||
if(!mmc_ok)
|
||||
FatalError(1);
|
||||
FatalError(ERROR_FILE_NOT_FOUND);
|
||||
} else
|
||||
fat_switch_to_usb(); // redirect file io to usb
|
||||
else {
|
||||
@ -169,11 +169,11 @@ int main(void)
|
||||
if(!mmc_ok) {
|
||||
#ifdef USB_STORAGE
|
||||
if(!GetUSBStorageDevices())
|
||||
FatalError(1);
|
||||
FatalError(ERROR_FILE_NOT_FOUND);
|
||||
|
||||
fat_switch_to_usb(); // redirect file io to usb
|
||||
#else
|
||||
FatalError(1);
|
||||
FatalError(ERROR_FILE_NOT_FOUND);
|
||||
#endif
|
||||
}
|
||||
#ifdef USB_STORAGE
|
||||
@ -181,7 +181,7 @@ int main(void)
|
||||
#endif
|
||||
|
||||
if (!FindDrive())
|
||||
FatalError(2);
|
||||
FatalError(ERROR_INVALID_DATA);
|
||||
|
||||
disk_ioctl(fs.pdrv, GET_SECTOR_COUNT, &storage_size);
|
||||
storage_size >>= 11;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user