mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-10 23:40:58 +00:00
boardloader: usability fixes
This commit is contained in:
parent
b6f9df10bb
commit
e8e3ed98f3
@ -57,19 +57,19 @@ static bool copy_sdcard(void)
|
|||||||
display_printf("applying bootloader in 10 seconds\n\n");
|
display_printf("applying bootloader in 10 seconds\n\n");
|
||||||
display_printf("unplug now if you want to abort\n\n");
|
display_printf("unplug now if you want to abort\n\n");
|
||||||
|
|
||||||
|
uint32_t codelen;
|
||||||
|
|
||||||
for (int i = 10; i >= 0; i--) {
|
for (int i = 10; i >= 0; i--) {
|
||||||
display_printf("%d ", i);
|
display_printf("%d ", i);
|
||||||
hal_delay(1000);
|
hal_delay(1000);
|
||||||
|
codelen = check_sdcard();
|
||||||
|
if (!codelen) {
|
||||||
|
display_printf("\n\nno SD card, aborting\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t codelen = check_sdcard();
|
display_printf("\n\nerasing flash:\n\n");
|
||||||
|
|
||||||
if (!codelen) {
|
|
||||||
display_printf("no SD card, aborting\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
display_printf("\n\nerasing flash:\n");
|
|
||||||
|
|
||||||
// erase flash (except boardloader)
|
// erase flash (except boardloader)
|
||||||
if (!flash_erase_sectors(FLASH_SECTOR_BOARDLOADER_END + 1, FLASH_SECTOR_FIRMWARE_END, progress_callback)) {
|
if (!flash_erase_sectors(FLASH_SECTOR_BOARDLOADER_END + 1, FLASH_SECTOR_FIRMWARE_END, progress_callback)) {
|
||||||
@ -143,7 +143,7 @@ int main(void)
|
|||||||
ensure(0 == sdcard_init(), NULL);
|
ensure(0 == sdcard_init(), NULL);
|
||||||
|
|
||||||
if (check_sdcard()) {
|
if (check_sdcard()) {
|
||||||
ensure(copy_sdcard(), NULL);
|
copy_sdcard();
|
||||||
shutdown();
|
shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user