bios/boot: use progress bar in copy_image_from_sdcard_to_ram.

This commit is contained in:
Florent Kermarrec 2020-06-09 20:00:32 +02:00
parent 21b9239dc0
commit fe9b42facf
1 changed files with 5 additions and 0 deletions

View File

@ -547,11 +547,16 @@ static int copy_image_from_sdcard_to_ram(const char * filename, unsigned int ram
if (fr == FR_OK){ if (fr == FR_OK){
printf("Copying %d bytes from %s to 0x%08x...\n", f_size(&file), filename, ram_address); printf("Copying %d bytes from %s to 0x%08x...\n", f_size(&file), filename, ram_address);
offset = 0; offset = 0;
init_progression_bar(f_size(&file));
for (;;) { for (;;) {
fr = f_read(&file, (void *) ram_address + offset, 512, &br); fr = f_read(&file, (void *) ram_address + offset, 512, &br);
if (br == 0) break; if (br == 0) break;
offset += br; offset += br;
if (offset%(512*128) == 0)
show_progress(offset);
} }
show_progress(offset);
printf("\n");
} else { } else {
printf("%s file not found.\n", filename); printf("%s file not found.\n", filename);
return 0; return 0;