clean up the e200r installer app to make it more user friendly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15104 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e329a45add
commit
d777a367ad
1 changed files with 19 additions and 5 deletions
|
@ -35,6 +35,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
#include "backlight-target.h"
|
#include "backlight-target.h"
|
||||||
|
#include "power.h"
|
||||||
|
|
||||||
/* Bootloader version */
|
/* Bootloader version */
|
||||||
char version[] = APPSVERSION;
|
char version[] = APPSVERSION;
|
||||||
|
@ -75,6 +76,7 @@ void* main(void)
|
||||||
printf("Rockbox e200R installer");
|
printf("Rockbox e200R installer");
|
||||||
printf("Version: %s", version);
|
printf("Version: %s", version);
|
||||||
printf(MODEL_NAME);
|
printf(MODEL_NAME);
|
||||||
|
printf("");
|
||||||
|
|
||||||
i=ata_init();
|
i=ata_init();
|
||||||
disk_init(IF_MV(0));
|
disk_init(IF_MV(0));
|
||||||
|
@ -84,18 +86,21 @@ void* main(void)
|
||||||
error(EDISK,num_partitions);
|
error(EDISK,num_partitions);
|
||||||
}
|
}
|
||||||
pinfo = disk_partinfo(1);
|
pinfo = disk_partinfo(1);
|
||||||
|
#if 0 /* not needed in release builds */
|
||||||
printf("--- Partition info ---");
|
printf("--- Partition info ---");
|
||||||
printf("start: %x", pinfo->start);
|
printf("start: %x", pinfo->start);
|
||||||
printf("size: %x", pinfo->size);
|
printf("size: %x", pinfo->size);
|
||||||
printf("type: %x", pinfo->type);
|
printf("type: %x", pinfo->type);
|
||||||
printf("reading: %x", (START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK)*512);
|
printf("reading: %x", (START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK)*512);
|
||||||
|
#endif
|
||||||
ata_read_sectors(IF_MV2(0,)
|
ata_read_sectors(IF_MV2(0,)
|
||||||
pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK,
|
pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK,
|
||||||
1 , sector);
|
1 , sector);
|
||||||
crc32 = chksum_crc32 (sector, 512);
|
crc32 = chksum_crc32 (sector, 512);
|
||||||
|
#if 0 /* not needed in release builds */
|
||||||
printf("--- Hack Status ---");
|
printf("--- Hack Status ---");
|
||||||
printf("Sector checksum: %x", crc32);
|
printf("Sector checksum: %x", crc32);
|
||||||
|
#endif
|
||||||
if ((crc32 == KNOWN_CRC32) &&
|
if ((crc32 == KNOWN_CRC32) &&
|
||||||
!memcmp(§or[HACK_OFFSET], knownBytes,
|
!memcmp(§or[HACK_OFFSET], knownBytes,
|
||||||
sizeof(knownBytes)/sizeof(*knownBytes)))
|
sizeof(knownBytes)/sizeof(*knownBytes)))
|
||||||
|
@ -106,14 +111,23 @@ void* main(void)
|
||||||
ata_write_sectors(IF_MV2(0,)
|
ata_write_sectors(IF_MV2(0,)
|
||||||
pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK,
|
pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK,
|
||||||
1 , sector);
|
1 , sector);
|
||||||
printf("Firmware Hacked");
|
printf("Firmware Unlocked");
|
||||||
printf("Proceed to Step 2");
|
printf("Proceed to Step 2");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf("Unknown bootloader... aborted");
|
{
|
||||||
|
printf("Unknown bootloader");
|
||||||
|
printf("Rockbox installer cannot");
|
||||||
|
printf("continue");
|
||||||
|
}
|
||||||
GPIOG_OUTPUT_VAL &=~0x80;
|
GPIOG_OUTPUT_VAL &=~0x80;
|
||||||
|
printf("");
|
||||||
while(1);
|
if (button_hold())
|
||||||
|
printf("Release Hold and");
|
||||||
|
printf("Press any key to shutdown");
|
||||||
|
while(button_read_device() == BUTTON_NONE)
|
||||||
|
;
|
||||||
|
power_off();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue